IMD 1.18: 23/09/2013 10:48:05 nasa-ames demo1:  @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  DEMO1 Z  GLOBE.FOTO"* NOTE.TEXT\ DISPLAY.TEXT\ DISPLAY.CODE\ TIMINGS.TEXT\RK4TH.DOC.TEXT\RK4TH.BAS.TEXT\RK4TH.PAS.TEXT\RK4TH.FOR.TEXT\ DEMO3D.TEXT\ ADVECT.TEXT\ NEWNOTE.TEXT\ DEMO1 Z  GLOBE.FOTO"* NOTE.TEXT\ DISPLAY.TEXT\ DISPLAY.CODE\ TIMINGS.TEXT\RK4TH.DOC.TEXT\RK4TH.BAS.TEXT\RK4TH.PAS.TEXT\RK4TH.FOR.TEXT\ 0~? q ~a@>3@8&g@  ( Dpp/ |@ DEMO3D.TEXT\ ADVECT.TEXT\ NEWNOTE.TEXT\  H@@ T4h P @ TPH Tp @` PPP(  4   %$ %@@0 ~a0 8&DD _ |@@` J @ @J@dX@@'@ *@(( @`R@ @HTH T@ 4@18`@p( À |'0Q@ (( @0))P@(**PpL p?@"P1:8 X ~8 @ @$**P @$** @***X `***X` X***TpX G***TG @**?@0P0@ 0@ PP@    @  @ @@ @ ` ``` P @ %HP0@ %H0 @ JTd0  JT( T( W(` x P(D (_(D (P(GPW( $(jP0T@HT H TH ( T ** @ **` P@**`@**@@**@H@**(@JJ?JJ100  `pχ`|'0D8?Jp? 4P@ *T@ @+++T@ @`(((T@ @D///T@ @D(((T@ @G+++T@ @ $(***T@ G***TG X***TpX ` **X` @ **X@@ **@**@    @CT``B @ T  B @A TB @ T@B @4@B @@$ B  &00@P P   788='x,iH`b@3QW@`?5@@A `@a @ P@Z @ P@ F@   H:@ B 80X?B C@@ @g((Td B B@8%$ (T? B8&,4T?B @CJ@@,4TB @CL/7T@) B xC (@0T*@B C/`@ ?T@*hB C/7T*B zC(`,`4TB FC0 , 4T  ?B BCP,4T @ @C`,4T B @C4TAB ??¿ ?B{:0Bp , g@1@\x0`xB0BBBBBBB@@  8 0C`@o $ @ x 7 ~ ``kl904<`{@4?; `= 0X`YxpH@}9  2 `0p```w30p13>`D\@`  Ѕ ~~ ?><0~8p`|@8 x`p   ;`8x 3  @ @7@`' @8@@@    0@  @@`P@   p @@P` @@P@:`@``@  ,n  `80@ 4@@@  0  @@@@ `@v@   @ @o@ @    @0@```?`    @ 8 ;   @ `08@0>0   0`y0_ˁ  Yq0  `@@  @ q!  @a> @ǁ@ @ @@  ?`0`@/?0A @@@ 0@0 @D $  ` @@d2 8@p8`x8<`p 0x  @086`,@ (;P@q? `8) ( ~ ?><08J @0h00| 08| 0 `0`v8>}a100?<<  |0~`<8`|00<`81y 0|O@88 ?{L`>4<@j 4 @t >m3?x!Xo  G@y  @@@"D@ " #T@ @ `  L @@0`` @     @/ .0( @    0 `@@ $  8ȁ  @  0 8@(p{P  @. @@  P@P`@p $` `Y` @ 8@ ) ܿ808P@ 0 X` @@@@ `x `$@@"@   @a1 8 p8 `p8<px>?0 @@  ?@~8` 48``@@  0:  05<`@o@000c8p~ $ : >_ 0 wߐ 8;ܽg@@ qp` 0|2ÇO lp@?p`><a>[~3 ?^x8~< @r 6 s | ` b0eu$k08|??0Kq ;Q`~q@ @848 K> < @o  @( 0 =p@@;P@@ ~8`$`$``   0X" 2@"p 0@0#0Fp`x0 ``@@(@0 @@~@@ @ @ @`` @  @       @   @ @ 0@ @.@%A` px>?@@  @`0 8p0`p8< O60 ` &``0<` h@@;` @ p`@ ???<0`x `7x`lx N>?8?@ )p3 >a0 9 {8<O8` (@ @ c  0<  pl0#@@ p<@`p}@@88{@@`3@@ 8``?`   `@{? @p ~ 8.0!0`@?p@ s0_>= pp88`@ .`@ @S`` `0 @ `O`@n ?      <l \@ 0  @00`0((:H`@h@ H  @  + d `Dd b  | 1̺"20 C@?@@ 0@p@p@"D`0@PPp@@@  @8`0 8p0|p8<px>? 0|x `x1@X"8f0<8gcx@C808@@K l `~<g` ` 4@< ,@0` @C 8!|80p @00@ 0 pl|~mH `@ @ @  1>8 c@w<8@F `0_<03>  4@`0 ` `z`@0 AC@` ??0<0  08<r  f o o8|?`| @=@x 6?  `2@LX '@ " || LFVD H 0 X X X @ @@0 x `  ` `a0 @PX`@P PP>OQ @؉s p\ @``L&,`x$ , ,  n<  & F0 cG8p!# `p8<px x>?8p0  0  088p8$A  <:  ;  @ `<02````@` @> 0030qp8  =  |~xx# 0@  E0x<44㙧 h@H@ A8 k p@PpP`?.0?@$&x@@($`m<`Y 0>\   #  =   92fJ @@ D GdODA"c0 XA@z?A C?C`03@ 7G ?@Z   <@8`C ̉ȅ~   3(00@@o _A p8|x<>? C {Oc   A8p} @0 9 /`@ qC` 8 pG@@!@@0>@;3``@0` `  6 0x PPP }0 `C@`0    p  < B A `0`0N w8@00x@ 8 `O?>?pp7`h;:<@x X:/  p(0D(D\H@?#04 D<(D4D,`@DxD~D 8:@P 0ُ  @  @ Hp00 BBA@8,@@ @@ p|1@K`  `C A @ p|<<p` ```@F@001 (@@@`@h8 p0H@h@`x`10N 8 ` p8?  @ @p|  ~?>>< >?? }x0a@ 8x>8h-` pO`  |\(~` <z~`  , @ l0  p?<0 |  @> @ l 6$@ `0  $ @ $X`  Hu " :F 76?x0,0 40  o8>70`?8 Q`p N0Q `@C??@? 8x@@@@ >= _`@a ``t 0080PP0`@p8x< ? wp8 p( xh @@` v>>x   H 0x ?8@` q `@8@@80  @@ @@@8Fp; O @``(00 (  `p8<4 (~ @0hvp0y0`1V0x ?*``20p@T8?$H DHp4H@ `$    n  @  @^ @ 01p8 8p@}@@@?  @C ?\  7??><0p+08  ~_0>`~=   L D<0 F4 <$Y "4= d ! @! ( 0>?p 0 "  $` (@@8^ y 0@@< @@8i ```x  @  0>  0,@l@ر l>   8<t`(`$`d<0{ >` 3C&@`PPD0`>`kp ?p8X@3؇ 8?( (D  (B ( ? 0i|?x  ( (@ 0f ` 6@@~p` Y@ ` ` :`0!aP! # ;F! &@  P`@  @@ @(p0x`@@+p p9 >v` @O?i0D@  $`pH" 9%p*0#  0 `@<"<0@p   $ 0` p @q`C@B  @ @¿@4`pT0@ @d@2RD sD@`ƒf@/R@@Q@p@  `4 0@@@ 8p@ `  `! 0`  / ) `=<" ><0>8`80 ` @x<8# 0 `@* $  8|0@`@ @@   @|`; 0'`@ `@   a   ` 柆y"   @    !sL=0Lϡ @@c`@` `m M`178"  @ qdp<` Hf < ` `  ? ;    @ @ B  @ @0 @ 0  x ` @ 8 `]@@"@@   l܆l ``4`/t '$ @ ! `0D  $ @Px@@n@!A  @ B.$H? P @0 0   @ ` <0` @@@0 ` p @p@ @@@8p }n o@b @<`  # @p`0`~@;<`p| d@7  px@( ,0 P @>80\?`@8Ȁ_@@(&@?A| e *p6C@?'G @8  N ?Fx ;%p C> l1% <3 ;8`00t?08(`>80`@` ?`0?8?`a9& 0w!gb8{  @ C D ?<  x  0 ,   Px@p    $, L00  @` `@@@ L @x(P@(@@8@0@@׃`0((`H `` 4 ``x +  $+  P @P`~  P` :@0c*@&L \P  0P# /@  @> @` 3 TPp\X<mt3?0>p@;`@>m@ (P7t(u( S0?a&` r` G |` > x  0    00 0 @A@   , @ `X# pA?^. 0 p ' 4B|@Q,gB`@"e@@`p8< @    @px@`Ч@Б0"I >h`"f`eM0@v? 8Dp`$   `  @8@p `H$ @@@ @0 @@nl  @`  @  ` @ <   ` 0@0 `   @`8p%0v #P}!  he!@)(0`( ??<`f?78;``@XzX >< @8}Xo<<x.pc?;x0``@<m<Q?` x `G0k| `@@`@ ) 0@ (7P H` @'`` (  @`` .@`@  @ @ @`    @@  0 @ A`0p0 pP@}t 0% 0K 0; <0  @p 0Z @ @?01 2@Nl@O@@. @@1d`` C @  @78 !0ʚx z x !00a@#  >   6 @ \ @0\ I\  @ @8hy@    P 90ư@: <`5@0    8W@@(t@@{~d 0@ @0; ```    @ @@J $@ * 0@ 0@  @0  @@`0  8pp0@s@ syA8@@0N@@ /,`8<!`0```   pw@8$ (0HS 00 >p|x 00@{ >`@?@`@0 + 7?a?0?0@70 ~`f@?f080`86@g13p} c@ 8 p³xpx|@?0pg$p x@pp?xz@<t ~0A> A>!@`4@ܟ`@><0> 8, @~`$` Bi0 ~ Y @A O  08@`  ܑt ` 6 Q    :( p   ! ps L <@` @ \ L0 @ 2x "adHAL`8 D   < /`a<X@<X@`*q@@@ `@( @8 ! ` /`' c0X0( 80X `P p`@@@G0gf=P  @@@`  @ A@  @`@d@00( d@ X "@ h p ` B@ B@` @`@  ` 0  f  |5?(9/>7] @'0@I @@ @0 - 0``a @>p@8<0 ( 8&<p`x0 ?> `@?@ @00 @@@   @@0 @ @ `@ 0`@  @ 8 @pp @@ . | <@ x@@p `@08›p@@A{x0a   x; M@`0 6`0>@?=0_`??><8?0 > 0``po0x1@<p@08p`|8p@ `c}o0 / `&q` '   @ !.`J M"@ d@    ` @ 0@ P? @@0@!@1@@ W,@8"`!`p    |   & $4 $`  ` 2$p@lb $`@$``% @@0@ pPPph0L`7D`86D `؉%<D~P.` @ ,] &q8pA H7-p.`@8:1" b2@3$`P @! #r  v 080 7`  `@Ћ x @<tx@@P08 @0@@6pq  0 @0  ?@0@`@`  @@  a !@`p0$ 8p0`` p 8< p`8x?>`@@?  @  1 w9@88      `~x`00 @`@898 x?x aop`@ {@ ;g(-q  >  {<0ax8`@pP@w0p@8N@ g s8  d /0) @ h`@!0h0`@@?>wp@@x0@8p  2 Y|`8Da <eDa   0Da((DdD"  00@`Ā Ïp @@``@0 Ā 1>Ā H@@X` 8@@@ ?`@@ 00D` d` " fB@( @$@<@d&`bh$`ܑ|`%0c_pЀ1P`  @98 @@@@@@/h\=CQG @ @ @ ,p,x@@`@`@1@880a$ 06Fn@ T 0 @ @@03 q @8`};<px>??@@  @@0 @0@b@!@  @@l 4 4 oޏ g X`0?0Z?@`@@?@  0_}0`~`    3 /# 0030 @@@@` @`~@0 p@( ?>0""@" `00`8:3 8+@*  9H0+ O 0L* @ (@ p@``d ̴@ 0@`p@@@@~2p#< P<@@` }Π @@@ aB  ```  aq8 @  @B00   @ D dH@ $(  0 @@.@p@ $(@{Q $(@@pv ((` @0! @@ 0   @h H( H(   `@8|@@ 03   @  @ @ @ @  0 0P0` @6 @`@ @ ``    @`0", x0`p'8qx>?7 >w|0'p6D`pK 0a8o 1@ ̱0` @a   0- xp`0 ` @ @  00? 0<  G`@x@8&@0 pF@@ LJ|d0w> p``@ 3@p<O>{? @ `: @8 |  0P[P50p`  `   !0 0;`@ `- 0{~r0w`?  @|@ @@0 >@^ 5@53g@@w`#` p -?>0 _p9L =.A 01p80C x  c   F {?W`X? |F f@B0>Ā @ `1 "  j`0)@ 0 @8$8 x|6 @@@``@@! `|``@` ` @@ ; X @@0p 0 @ @8 @ @@@ @ @@ 0@     @` ``@@0 @}  _  0@hF@`~  @  @ @ `@ `p @ @ @ +@@@ @    p  ,   |0 , ( ( C~`pn@@p < 4 < @ X@X@ X8  < ?8 p8 80@@@8`@ @p`8<@p 0x08> = re at a  time in the direction specified (could use arrows instead). High and Low set  the picture number bounds for the pictures to be displayed. Movie steps  through the pictures from the current picture number in the current direction  to the proper bound and stops whereas Cycle continues to cycle through the  range set by the high and low commands. Any key will interrupt the movie or  cycle mode. Frame sets the current picture number and jumps to that picture.  Params displays the current parameter values and Display displays the current  picture (used after Param to get the picture back). Quit returns to the  monitor.  %The displays are:  *1. DEMO1:GLOBE A picture of the earth rotating. It wa cSept 24, 1978  1NOTES ON THE DISPLAYS AND THE DISPLAY PROGRAM  %These three disks contain some examples of our displayss made using -the DISSPLA software on a CDC 7600 computer. (A main use of the -TERAK is to conveniently prepare code for larg. To show the  displays, execute the DISPLAY program. (A copy of the code file is on each  disk, but the text file for this e computers and to -evaluate results from large computers with graphics).  *2. DEMO2:ADVECT A picture of the exact solutionprogram is on this disk only).  %The DISPLAY program first requests the name of the file to be displayed  (if the file ext for a density -perturbation being advected in a rotating fluid.  ension is not specified, it will default to FOTO). The right  arrow key steps forward a picture at a time and sets the directi*3. DEMO3:ADVECT A picture of the numerical solution for the same -physical process. The numerical technique used is typicalon to forward  for the movie or cycle mode. The left arrow steps backward a picture at a  time or sets the direction to rever of the -techniques used for weather prediction models. The numerical -solution artificially introduces a distortion -- this O^se for the movie or cycle mode. The  remaining functions that can be peformed with the DISPLAY program are  described by the prompts at the bottom of the screen. Newfile permits the  selection of a different file to be displayed. Step steps one pictu>  BLANKLINE(22); ,WRITE(OUTPUT,'Fotofile: '); ,READLN(INPUT,S); ,IF LENGTH(S)>0 /THEN BEGIN 4IF POS('.FOTO',S)=0 THEN S:=COdistortion -can be easily seen by comparing this picture with the picture for -the exact solution. The calculations for both of these last two -demonstrations were done completely on the TERAK.  %The programs used to generate the pictures in DEMO2: PROGRAM DISPLAY; (CONST .RIGHT=11; .LEFT=23; (TYPE .TERAKSCREEN = RECORD CASE BOOLEAN OF NU:=BLOCKREAD(F1,SCR1.DISKMAP,19,RELNU); >IF NU<>19 ATHEN BEGIN FLAST:=PICT-1; FPICT:=LAST; FEND AELSE BEGINRUE) THEN OFF:=1 ELSE OFF:=-1; 7IF PICT>LAST-OFF THEN PICT:=LAST-OFF; 7IF PICTNU:=BLOCKREAD(F1,SCR2.DISKMAP,19,RELNU); >IF NU<>19 AT+'f','F': BEGIN 6GOTOXY(74,0); 6WRITE(OUTPUT,'# '); 6GOTOXY(76,0); 6READLN(INPUT,PICT); 6IF (PICTLAST) THEN PICT:=LAST; 6CYCLE:=FALSE; 6MOVIE:=FALSE; 6DISP; 4END; +'l','L': BEGIN 7PARAMS; 7BLANKLINE(228GOTOXY(74,0); 8WRITE('# ',PICT,' '); 5END; *END; $ $PROCEDURE PGRAPH(VAR SCR: TERAKSCREEN); $EXTERNAL; $ $PROCEDURE G); 7WRITE(OUTPUT,' Lowest Frame is '); 7READLN(INPUT,START); 4 IF (START<1) THEN START:=1; 7BLANKLINE(22); 4 PARAMS; 4NCAT(S,'.FOTO'); 4RESET(F1,S); 4FILEO:=TRUE; 4END /ELSE FILEO:=FALSE; ,BLANKLINE(22); *END {FILEOPEN} ; ( (PROCEDURE DISRAPH; $ &BEGIN (IF BUF=1 THEN PGRAPH(SCR2) 1ELSE PGRAPH(SCR1); &END; $ $BEGIN 'BLANKLINE(0); 'FILLCHAR(SCR1.DISKMAP,SIZP; *BEGIN *IF (PARDIS=TRUE) THEN CLEARTEXT; *PARDIS:=FALSE; *IF FILEO THEN -IF MOVIE=TRUE 0THEN 3BEGIN 6UNITREAD(2,INTEREOF(SCR1),CHR(0)); 'FILLCHAR(SCR2.DISKMAP,SIZEOF(SCR2),CHR(0)); 'FILLCHAR(SCR3.DISKMAP,SIZEOF(SCR3),CHR(0)); 'FILEOPEN; 'MOV[0],1,,1); 6REPEAT 9IF FORWRD=TRUE THEN PICT:=PICT+1 ELSE PICT:=PICT-1; 9RELNU:=19*(PICT-1); 9IF BUF=1 ;THEN =BEGIN ?NU:IE:=FALSE; 'START:=1; 'PICT:=0; 'LAST:=26; 'FORWRD:=TRUE; 'QUIT:=FALSE; 'CYCLE:=FALSE; 'BUF:=1; 'WHILE QUIT=FALSE DO 'B=BLOCKREAD(F1,SCR1.DISKMAP,19,RELNU); ?IF NU<>19 BTHEN BEGIN GLAST:=PICT-1; GPICT:=LAST; GEND ? ELSE BEGIN EGIN *CYCLE:=FALSE; *MOVIE:=FALSE; *GOTOXY(0,23); *WRITE(OUTPUT,  '{Newfile, Step, Movie, Cycle, Frame, Low, High, Params, GUNITWRITE(3,SCR1.BITMAP,63); GBUF:=2; GEND; =END ;ELSE =BEGIN ?NU:=BLOCKREAD(F1,SCR2.DISKMAP,19,RELNU); ?IF NU<>19 BTHDisplay,Graph,Quit}'); *READ(INPUT,MODE); *IF (MODE=CHR(RIGHT)) {right arrow} -THEN BEGIN 2FORWRD:=TRUE; 2MODE:='S'; 2END;EN BEGIN GLAST:=PICT-1; GPICT:=LAST; GEND BELSE BEGIN GUNITWRITE(3,SCR2.BITMAP,63); GBUF:=1; GEND; =END; 9GOTOXY(74,0); *IF (MODE=CHR(LEFT)) {left arrow} -THEN BEGIN 2FORWRD:=FALSE; 2MODE:='S'; 2END; *CASE MODE OF +'s','S': BEGIN 7MOVIE:=F 9WRITE('# ',PICT,' '); 9IF (PICT>=LAST) AND (FORWRD=TRUE) AND (CYCLE=TRUE) 9 THEN PICT:=START-1; 9IF (PICT<=START) AND (ALSE; 7IF FORWRD=TRUE THEN PICT:=PICT+1 ELSE PICT:=PICT-1; 7IF PICT>LAST THEN PICT:=LAST; 7IF PICT((PICT>=LAST) AND (FOR7DISP; 4END; +'m','M': BEGIN 7MOVIE := TRUE; 7IF (FORWRD=TRUE) THEN OFF:=1 ELSE OFF:=-1; 7IF PICT>LAST-OFF THEN PICT:=LASTWRD=TRUE))) @AND (CYCLE=FALSE)) OR (NOT UNITBUSY(2)); 6UNITCLEAR(2); 3END 0ELSE 5BEGIN 8RELNU:=19*(PICT-1); 8IF BUF=1 :T-OFF; 7IF PICTՀ& & &      K{Newfile, Step, Movier DISPLAY , Cycle, Frame, Low, High, Params, Display,Graph,Quit}gg á Sggá Sgg    š ɡ  š땫 ɡ땫  š땫 ɡ땫 J#  L ɡ š  צ Lowest Frame is  ɡEND; +'h','H': BEGIN 7PARAMS; 7BLANKLINE(22); 7WRITE(OUTPUT,' Highest Frame is '); 7READLN(INPUT,LAST); 4 BLANKLINE(22); 4 PARAMS; 4END; +'q','Q': QUIT:=TRUE; +'i','I': ; +'n','N': BEGIN 6PARAMS; 6CLOSE(F1); 6FILEOPEN; 4 PARAMS; צL r ȡ4END; +'p','P': PARAMS; +'d','D': BEGIN 6IF (PICTLAST) THEN PICT:=LAST; 6CYCLE:=FALSE;   ?  Fotofile: i צ Direction: Forward 6MOVIE:=FALSE; 6DISP; 4END; +'g','G': GRAPH; +END; (END; (CLOSE(F1); $END. " צReverse צLowest Frame:  Highest Frame:  Current Frame:  צ Fotofile: i(išGצ.FOTOiá!ii(.FOTO-(iw.  á/ˡ A 7   n- F   P( |xZV NwMVJ J  )TIMING FOR FOURTH ORDER RUNGE KUTTA DIFFERENTIAL EQUATION SOLVER +(1000 STEPS FOR SECOND ORDER ORDINARY DIFFERENTIAL EQUATF 5D5<4,( $ @VTRd@fPOS l<ION)  %COMPUTER LANGUAGE TIME ; ?PRINTOUT EACH STEP NO PRINTOUT A ?LINEAR NONLIN;MOVELEFT;=MOVERIGHEXIT >IDSEARCH==TREESEARTIME EAR LINEAR NONLINEAR %  ACS PASCAL 254 73 %(Z80)   ALFA MICRO B <=FILLCHAROPENNEW <:>OPENOLD REWRITE <CLOSE 2=SEASIC # 164 203 108 148  %APPLE BASIC 390 490 350 EK  RESET ?!GET "PUT #SCAN $BLOCKREAH=450  (6502) % %CROMEMCO BASIC 1035 1813 915 1690 %Z-2D(Z80)  FORTR F^AN 188 270 85 167  %HP9830 BASIC # 930 1280 870 1210 % %HP 9845A BASIC # 117 159 80 122 0 %NORTHWEST PASCAL 235  90 %(8085/3MZ) % %NORTHSTAR BASIC 288 414 244 370 %(Z80) BASIC # 244 264 199 219  %PDP 11/40 BASIC # 142 150  103 108 % % FORTRAN # 67 69 8.5 12.5 % %PET BASIC 4 Highest Frame is   ɡ š  miCsb:'H|PC] $&(*,.02468:<>@zgFOSPRZ`ƹ:ƹB t2,e& " e  (  ~ B 80 595 398 510  (6502) % %TERAK BASIC # 195 215 95 105 %(LSI-11) 0FORTRAN # 71 80 16 25 @ * PASCAL # 178 187 O^ 49 58 0 %TDL BASIC 1012 805 %(Z80/2Mhz) % %TRS80 BASIC  740 690  (Z80)      # -- DESIGNATES WITH FLOATING POINT HARDWARE             NOTE: ADDITIONAL TIMES FOR COMPILING AND LINKING ARE  < COMPILE LINK  %ACS PASCAL 15 0 % %CROMEMCO FORTRAN 30 115  %NORTHWEST PASCAL 15 0 % %PDP 11/40 FORTRAN 8 32  %TERAK FORTRAN 30 42 0PASCAL 12 0 0BASIC 15 0  5ORDINARY DIFFERENTIAL EQUATION SOLVER   APPLICATION - Solves single or coupled ordinary differential equations   (These are probably the most common type of equations /encountered by scientists and engineers. For example, /ordinary differential equations occur in electronics, /dynamics, heat transfer, and vibrations problems)   METHOD - 4th Order Runge-Kutta   ADVANTAGES - This method has better accuracy and stability than the 1st and .2nd order methods usually used in C re ;desired)  6Y(1) is defined as the unknown of 1st equation 6Y(2) is defined as the unknown of the 2nd equation 6Y(3) is defined as the unknown of the 3rd equation 6etc  6F(1) is the derivative of the 1st unknown 6F(2) is the derivative of the 2nd unknown 6F(3) is the derivative of the 3rd unknown 6etc  ; -   .Step 3 Supply tBASIC programs to solve .ordinary differential equations.   PROCEDURE - 1. Convert higher order equations to first order hese definitions to the program at the locations 6indicated on the enclosed program  6100 N=2 number of equations equations by 1substitutions. (see example)  .2. Provide the information specified on the enclosed program   LIMITATIONS -6110 X=0 initial value of independent variable 6120 X1=100 final value of the independent variable 6130 H=0.1  The solutions become inaccurate and unstable whenever the step .size becomes appreciably larger than the smallest character-  step size of independent variable 6400 Y(1)=1.0 initial value of 1st dependent variable 6410 Y(2)=0.0 initial va.istic time of the problem. For example, when solving a .vibrating spring problem, the time step should be kept lue of 2nd dependent variable 6500 F(1)=Y(2) description of derivative of 1st var. 6510 F(2)=-0.3*Y(2)-SIN(Y(1)) Gdescript.significantly smaller than the period of the fastest .oscillation.   EXAMPLE - Equation Y'' + 0.3*Y' + SIN(Y) ion of derivative of 2nd var.  6  NOTE: The user should check the accuracy of the solution by comparing solutions  wi= O  .Initial Conditions Y = 1 at time = O DY'= O at time = O  .Step 1 Convert to 1st order equations  6let V = Y'th different step sizes.  6 6then the above equation becomes  :V' + 0.3*V + SIN(Y) = O . 6so the equivalent two first order equations are  :Y' = V for the 1st unknown variable Y :V' = - 0.3*V - SIN(Y) for the 2nd unknown variable V 6 .Step 2 Convert O^to the definitions in the program  6N is the number of first order equations to be solved  6X is defined as the independent variable 6 6H is the step size (interval of the independent variable 6 x for which values of the dependent variables aD +H*F(I)  830 NEXT I  840 X=X+0.5*H  850 RETURN  900 FOR I=1 TO N  910 Y(I)=S(I)+(P(I)+F(I))*H/6  920 NEXT I  930 RETURN 4S[I]:=Y[I]; 4P[I]:=DERIV[I]; 4Y[I]:=S[I]+0.5*H*DERIV[I]; 1END; .X:=X+0.5*H; +END; (PROCEDURE STEP2; +BEGIN .FOR I:=1 TO 9000 END                   NUEQNS DO 1BEGIN 4P[I]:=P[I]+2.0*DERIV[I]; 4Y[I]:=S[I]+0.5*H*DERIV[I]; 1END; +END; (PROCEDURE STEP3; +BEGIN .FOR I:=1 TO NUEQNS DO 1BEGIN 4P[I]:=P[I]+2.0*DERIV[I]; 4Y[I]:=S[I]+H*DERIV[I]; 1END; .X:=X+0.5*H; +END; (PROCEDURE STEP4; +BEGIN O^.FOR I:=1 TO NUEQNS DO 1BEGIN 4Y[I]:=S[I]+(P[I]+DERIV[I])*H/6.0; 1END; +END;  BEGIN &NUEQNS:=2; &X:=0.0; &ENDX:=100.0; &H:=0.1; &Y[1]:=1.0; &Y[2]:=0.0; &WRITELN(' X Y'); &WRITELN(X:15:4,Y[1]:15:4); &REPEAT )EVALUATE; )STEP1; )EVALUATE; )STEP2; )EVALUATE; )STEP3; )EVALUATE; )STEP4; )WRITELN(X:15:4,Y[1]:15:4); &UNTIL X>=ENDX;  100 N=2  110 X=0  120 X1=100  130 H=0.1  140 GOSUB 400  150 PRINT X,Y(1)  200 GOSUB 500  210 GOSUB 600  220 GOSUB 500  230 GOSUB 700  240 GOSUB 500  250 GOSUB 800  260 GOSUB 500  270 GOSUB 900  280 PRINT X,Y(1)  290 IF XEND; /END; )END; #BEGIN &TEST:=FALSE; &IF TEST=FALSE THEN REWRITE(F1,'FILM:MOVIE.FOTO'); &FILLCHAR(SCREEN,SIZEOF(SCREEN),FALSE); &UNITWRITE(3,SCREEN,63); &WRITELN(OUTPUT,'PROGRAM TO PLOT 3D '); &WRITE(' XORIGIN = '); READLN(XORIGIN); &WRITE(' YORIGIN = '); READLN(YORIGIN); &WRITE(' XRANGE  = '); READLN(XRANGE); &WRITE(' YRANGE = '); READLN(YRANGE); &WRITE(' TXRANGE = '); READLN(TXRANGE); &WRITE('NUMBER OF X INCREMENTS = '); READLN(NX); &WRITE('NUMBER OF Y INCREMENTS = '); READLN(NY); &WRITE(' MAXIMUM F = '); READLN(MAXF); PROGRAM DEMO3D; #VAR NU: INTEGER; )RANGE: INTEGER; )XRANGE,YRANGE,TXRANGE: INTEGER; )NX,NY: INTEGER; )I,J: INTEGER; )X,Y&WRITE('F TRANSLATION = '); READLN(TRANSF); &WRITE(' WIDTH OF F = '); READLN(WIDTHF); &DX:=XRANGE DIV NX; &DY:=-YRANGE DIV ,XORIGIN,YORIGIN,XBASE,DX,DY,DYX,XP,YP,OY: INTEGER; )DELTAX,DELTAY: INTEGER; )F: ARRAY[0..51,0..51] OF INTEGER; )FRAME: INTEGNY; &DYX:=(TXRANGE-XRANGE) DIV NY; &RNX:=NX; RNY:=NY; &PI:=3.14159; &THETA:=(-2.0*PI/18.0); &FRAME:=0; &REPEAT )THETA:=THER; )MAXF,TRANSF,WIDTHF: REAL; )PI,THETA,TFX,TFY: REAL; )RX,RY,RI,RJ,RNX,RNY: REAL; )RF: ARRAY[0..51,0..51] OF REAL; )TEST:ETA+(2.0*PI)/18.0; )TFX:=TRANSF*COS(THETA); )TFY:=TRANSF*SIN(THETA); )FOR J:=1 TO NY+1 DO ,BEGIN /RJ:=J-1;  BOOLEAN; )SCREEN: PACKED ARRAY[0..243,0..319] OF BOOLEAN; )F1: FILE; &PROCEDURE PLOT3D; )BEGIN ,FOR J:=1 TO NY+1 DO /BEGI/RY:=(((RJ-(RNY/2.0))/RNY)-TFY)/WIDTHF; /FOR I:=1 TO NX+1 DO 2BEGIN 5RI:=I-1; 5RX:=(((RI-(RNX/2.0))/RNX)-TFX)/WIDTHF; 5RFN 2OY:=YORIGIN+(J-1)*DY; 2YP:=OY; 2XBASE:=XORIGIN+(J-1)*DYX; 2XP:=XBASE; 2FOR I:=1 TO NX+1 DO 5BEGIN 8X:=XBASE+(I-1)*DX; [I,J]:=EXP(-(RX*RX+RY*RY))*MAXF; 5F[I,J]:=TRUNC(RF[I,J]); 2END; ,END; )PLOT3D; )FRAME:=FRAME+1; )WRITELN('FRAME = ',FRAME,8Y:=OY-F[I,J]; 8IF (XP>0) AND (XP<320) AND (X>0) AND (X<320) AND ;(YP>0) AND (YP<240) AND (Y>0) AND (Y<240) THEN >BEGIN AD' THETA = ',THETA); )IF TEST=FALSE THEN ,BEGIN /NU:=BLOCKWRITE(F1,SCREEN,19); ,END; )FILLCHAR(SCREEN,SIZEOF(SCREEN),FALELTAX:=X-XP; ADELTAY:=Y-YP; ADRAWLINE(RANGE,SCREEN,20,XP,YP,DELTAX,DELTAY,1); >END; 8XP:=X; 8YP:=Y; 5END; 2Y:=OY; SE); %UNTIL FRAME=20; %IF TEST=FALSE THEN CLOSE(F1,LOCK); "END.  2IF (XP>0) AND (XP<320) AND (X>0) AND (X<320) AND ;(YP>0) AND (YP<240) AND (Y>0) AND (Y<240) THEN >BEGIN ADELTAX:=X-XP; G  >RF[I,J,K]:=EXP(-(RX*RX+RY*RY))*MAXF; >RF[I,J,2]:=RF[I,J,K]; >F[I,J]:=TRUNC(RF[I,J,K]); ;END; 5END; 2PLOT3D; 2IF PICTIND PROGRAM ADVECT; #CONST PI=3.14159; #VAR NU: INTEGER; )RANGE: INTEGER; )XRANGE,YRANGE,TXRANGE: INTEGER; )NX,NY: INTEGER;X<=0 THEN 5BEGIN 8PICTINDX:=PICTINT; 8FRAME:=FRAME+1; 8WRITELN('FRAME = ',FRAME); 8IF TEST=FALSE THEN ;BEGIN >NU:=BLOCK )I,J,K,OLD,PRES,NEW: INTEGER; )X,Y,XORIGIN,YORIGIN,XBASE,DX,DY,DYX,XP,YP,OY: INTEGER; )DELTAX,DELTAY: INTEGER; )F: ARRAY[0..31,0..31] OF INTEGER; )PICTINT,PICTINDX,FRAME: INTEGER; )MAXF,TRANSF,WIDTHF: REAL; )ANGLVEL,THETA,TFX,TFY: REAL; )RX,RY,RI,RJ,RK,RNX,RNY: REAL; )U,V: ARRAY[0..31,0..31] OF REAL; )RF: ARRAY[0..31,0..31,0..2] OF REAL; )T: CHAR; )TEST: BOOLEAN; )SCREEN: PACKED ARRAY[0..243,0..319] OF BOOLEAN; )F1: FILE; &PROCEDURE PLOT3D; )BEGIN ,FOR J:=1 TO NY+1 DO /BEGIN 2OY:=YORIGINO^+(J-1)*DY; 2YP:=OY; 2XBASE:=XORIGIN+(J-1)*DYX; 2XP:=XBASE; 2FOR I:=1 TO NX+1 DO 5BEGIN 8X:=XBASE+(I-1)*DX; 8Y:=OY-F[I,J]; 8IF (XP>0) AND (XP<320) AND (X>0) AND (X<320) AND ;(YP>0) AND (YP<240) AND (Y>0) AND (Y<240) THEN >BEGIN @DELTAX:=X-XP; @DELTAY:=Y-YP; @DRAWLINE(RANGE,SCREEN,20,XP,YP,DELTAX,DELTAY,1); >END; 8XP:=X; 8YP:=Y; 5END; 2Y:=OY; 2IF (XP>0) AND (XP<320) AND (X>0) AND (X<320) AND ;(YP>0) AND (YP<240) AND (Y>0) AND (Y<240) THEN >BEGIN @DELTAX:=X-XP; @DELTAY:=Y-YP; @DRAWLINE(RANGE,SCREEN,20,XP,YP,DELTAX,DELTAY,1); >END; /END; )END; &PROCEDURE INIT; )BEGIN ,FOR K:=0 TO 1 DO /BEGIN 2RK:=K; 2THETA:=RK*ANGLVEL; 2TFX:=TRANSF*COS(THETA); 2TFY:=TRANSF*SIN(THETA); 2FOR J:=1 TO NY+1 DO 5BEGIN 8RJ:=J-1; 8RY:=(((RJ-(RNY/2.0))/RNY)-TFY)/WIDTHF; 8FOR I:=1 TO NX+1 DO ;BEGIN >RI:=I-1; >RX:=(((RI-(RNX/2.0))/RNX)-TFX)/WIDTHF;H TE(' XRANGE = '); READLN(XRANGE); &WRITE(' YRANGE = '); READLN(YRANGE); &WRITE(' TXRANGE = '); READLN(TXRANGE); &WRITE('NUMBER OF X INCREMENTS = '); READLN(NX); &WRITE('NUMBER OF Y INCREMENTS = '); READLN(NY); &WRITE(' MAXIMUM F = '); READLN(MAXF); &WRITE('F TRANSLATION = '); READLN(TRANSF); &WRITE(' WIDTH OF F = '); READLN(WIDTHF); &WRITE('PICTURE INTERVAL = '); READLN(PICTINT); &DX:=XRANGE DIV NX; &DY:=-YRANGE DIV NY; &DYX:=(TXRANGE-XRANGE) DIV NY; &RNX:=NX; RNY:=NY; &THETA:=0.0; &ANGLVEL:=PI/(9.0*PICTINT); &FRAME:=0; &PICTINDX:=0; &INIT; &VEL; &NEW:=1; &PRES:=0; WRITE(F1,SCREEN,19); ;END; 5END; 2PICTINDX:=PICTINDX-1; 2FILLCHAR(SCREEN,SIZEOF(SCREEN),FALSE); /END; )END; &PROCEDURE VE&REPEAT )STEP; )PLOT3D; )IF PICTINDX<=0 THEN ,BEGIN /PICTINDX:=PICTINT; /FRAME:=FRAME+1; /WRITELN('FRAME = ',FRAME); /IFL; )BEGIN ,FOR J:=1 TO NY+1 DO /BEGIN 2RJ:=J-1.0; 2RY:=RJ-(RNY/2.0); 5FOR I:= 1 TO NX+1 DO 8BEGIN ;RI:=I-1;  TEST=FALSE THEN 2BEGIN 5NU:=BLOCKWRITE(F1,SCREEN,19); 2END; ,END; )PICTINDX:=PICTINDX-1; )FILLCHAR(SCREEN,SIZEOF(SCREEN);RX:=RI-(RNX/2.0); ;U[I,J]:=-ANGLVEL*RY; ;V[I,J]:=ANGLVEL*RX; 8END; /END; )END; &PROCEDURE STEP; )BEGIN ,OLD:=PRES; ,P,FALSE); &UNTIL FRAME=20; &IF TEST=FALSE THEN CLOSE(F1,LOCK); #END. RES:=NEW; ,NEW:=NEW+1; ,IF NEW>2 THEN NEW:=0; ,FOR J:=2 TO NY DO /BEGIN 2FOR I:=2 TO NX DO 5BEGIN 8RF[I,J,NEW]:=RF[I,J,OLD]-(RF[I+1,J,PRES]*U[I+1,J]- RRF[I-1,J,PRES]*U[I-1,J]+ RRF[I,J+1,PRES]*V[I,J+1]- RRF[I,J-1,PRES]*V[I,J-1]); 8F[I,J]:=TRUNC(RF[I,J,NEW]); 5END; /END; )END; #BEGIN &WRITE(' TEST = '); READLN(T); &IF T='F' THEN TEST:=FALSE ELSE TEST:=TRUE; M^&IF TEST=FALSE THEN REWRITE(F1,'FILM:MOVIE.FOTO'); &FILLCHAR(SCREEN,SIZEOF(SCREEN),FALSE); &UNITWRITE(3,SCREEN,63); &WRITELN(OUTPUT,'PROGRAM TO PLOT 3D '); &WRITE(' XORIGIN = '); READLN(XORIGIN); &WRITE(' YORIGIN = '); READLN(YORIGIN); &WRII o me at the next meeting if you like.  % aVal Watson he program  ;must immediately send a second 3  ;  ;Between each row, the printer requires an ASCII ETX,STX,VT,VT. The ETX is  ;the control byte, the STX puts in text mode, and VT moves 1/2 a graphics  ;row vertically.  ( (.PROC PGRAPH,1  MAIN MOV (SP)+,RETURN ;pull return address from the stack (MOV (SP)+,BASE ;pull screen memory address from the stack (MOV BASE,VBASE ;VBASE is the mem addr for 7th row of bits (ADD #360,VBASE (JSR PC,PRINTP ;print full page (screen) (MOV RETURN,-(SP) ;put return address on stack (RTS PC ;and return (   PRINTP MOV #42,COUNTP ;sub to print full screen - 34 rows of 7 bits (MOV VBASE,JADD ;JADD is the mem address of start of each row  LOOPP JSR PC,PRINTR ;print row (ADD #430,JADD ;increment JADD by 280 (7*320/8) (DEC CO ;This program provides a hardcopy of a 320X238 bit map on the Dataproducts  ;printer in approximately 40 seconds when the speUNTP (BNE LOOPP (RTS PC    PRINTR MOV#24,COUNTR ;sub to print row of 7 bit columns (MOV JADD,HADD ;`Jan 19, 1981   Roger,   Enclosed are the demonstrations for version 2.0. The file NOTE.TEXT on  DEMO1: describes the ded is 9600 bps.  ;  ;The starting address of the screen is the parameter passed to this subroutine  ;  ;The printer requiresemonstrations and the use of the program to show the  demonstrations, DISPLAY.   I have modified the program DISPLAY to prov the Terak to send an ASCII ETX to turn on the graphics  ;Then the following bytes sent represent 7 bit columns on the screen aide a hardcopy of the screen on a  Dataproducts T-80G printer (using a single keystrokelike the other commands  in DISPLAY). nd on  ;the printer - bit 0 in the byte sent to the printer causes the highest dot  ;of the 7 positions used on the print headThe source and code files to drive the T-80G printer are on  the disk DEMO2:, and the directions on their use is the file DIREC to be printed. Bit 7 is set to 0.  ;Any occurance of a byte with value 3 (ETX) is interpreted as a control.  ;A double ETX iT.TEXT on  that disk. These can be used at 9600 bps because they use hardware  handshaking.  You can return these ts interpreted as a graphics 3. Therefore, the graphics data  ;must be monitored for the occurance of a 3, and if a 3 occurs, tJ (JSR PC,PRETX ;Dataproducts requires ETX,STX,VT,VT between (JSR PC,PRSTX ; each row of graphics (JSR PC ETX,R1 ;sub to print ETX (JSR PC,PRINT1 (RTS PC ( (  PRSTX MOV STX,R1 ;sub to print STX (JSR ,PRVT (JSR PC,WAITT ;brief wait for hardware handshaking (JSR PC,PRVT (JSR PC,WAITT (RTS PC    PRINTW MOV #PC,PRINT1 (RTS PC ( (  PRVT MOV VT,R1 ;sub to print VT (JSR PC,PRINT1 (RTS PC ( (  PRINT1 BIT #200,@X20,COUNTW ;sub to print 16 of the 7 bit columns (CLR BSHIFT  LOOPW MOV HADD,WADD ;WADD is mem address of SR ;sub to send a byte to the printer (BEQ PRINT1 ;wait for finished sending last byte word getting bit from  JSR PC,PACKR1 ;pack 7 bit column into reg 1 (JSR PC,PRINT1 ;send contents o LOOP2 BIT #100000,@XSR ;wait for printer ready - pin 19 on printer (BEQ LOOP2 (MOV R1,@XDB ;send to prif reg 1 to printer (CMP ETX,R1 ;if byte sent was 3 (ETX), send another ETX (BNE NOTETX ; (single ETXnt reg (RTS PC    WAITT MOV WTIME,WCOUNT  LOOPWA DEC WCOUNT (BNE LOOPWA (RTS PC (   BASE .WORD  is control char) (JSR PC,PRETX ; (double ETX is interpreted as graphics 3)  NOTETX INC BSHIFT ;bshif ;mem address for start of screen  BCOUNT .WORD ;position of desired bit in word  BSHIFT .WORD t is the bit position in the word (DEC COUNTW (BNE LOOPW (RTS PC    PACKR1 CLR R1 ;sub to pack 7 bit c ;position of desired bit in word  COUNTP .WORD ;counter for the 40 rows in a screen (page)  COUNTolumn into reg 1 (MOV #7,VCOUNT ;vcount is bit position in 7 bit column R .WORD ;counter for the 20 words in a 320 bit row  COUNTW .WORD ;counter for the 16 bits LOOPPR ASL R1 ;shift reg 1 to make room for next bit of col (JSR PC,MASKB ;get proper bit from w in a word  ETX .WORD 3 ;ASCII ETX  HADD .WORD ;mem address of word with bit 7 of 7 bord by masking (BIS R0,R1 ;or it with reg 1 (SUB #50,WADD ;decrement word address - 320 bits=40*8 (Dit col  JADD .WORD ;mem address of start of row of 7 bit cols  MASK .WORD 177776 ;mask to dEC VCOUNT (BNE LOOPPR (RTS PC ( (  MASKB MOV @WADD,R0 ;sub to select bit in word by masking (MOV BSHIFT,BCOUNelete all but bit 0  RETURN .WORD ;return address  STX .WORD 2 ;ASCII STX HADD is the mem address of word for bit 7  JSR PC,PRETX ;Dataproducts requires ETX to turn on graphics  LOT ; -- the word is loaded into reg 0,  LOOPBS BEQ ENDBS ; rotated until bit desired is bit 0, (ASR R0 OPR JSR PC,PRINTW ;print next 16 of the 7 bit columns (INC HADD (INC HADD (DEC COUNTR (BNE LOOPR  ; and all other bits masked off (DEC BCOUNT (JMP LOOPBS  ENDBS BIC MASK,R0 (RTS PC    PRETX MOVK art of each row  LOOPP JSR PC,PRINTR ;print row (ADD #430,JADD ;increment JADD by 280 (7*320/8) (DEC COord by masking (BIS R0,R1 ;or it with reg 1 (SUB #50,WADD ;decrement word address - 320 bits=40*8 (D VBASE .WORD ;mem address for 7th row of bits on screen  VCOUNT .WORD ;counter for posiUNTP (BNE LOOPP (RTS PC    PRINTR MOV#24,COUNTR ;sub to print row of 7 bit columns (MOV JADD,HADD ;tion on 7 bit column  VT .WORD 13 ;ASCII VT  WADD .WORD ;mem address for word with biHADD is the mem address of word for bit 7  JSR PC,PRETX ;Dataproducts requires ETX to turn on graphics  LOt to extract  WCOUNT .WORD ;counter for time delay sub  WTIME .WORD 500 ;cycles to wait forOPR JSR PC,PRINTW ;print next 16 of the 7 bit columns (INC HADD (INC HADD (DEC COUNTR (BNE LOOPR  handshaking signal  XDB .WORD 177520+6 ;address of status reg  XSR .WORD 177520+4 ;address of the p(JSR PC,PRETX ;Dataproducts requires ETX,STX,VT,VT between (JSR PC,PRSTX ; each row of graphics (JSR PCrint reg  (.END ( ,PRVT (JSR PC,WAITT ;brief wait for hardware handshaking (JSR PC,PRVT (JSR PC,WAITT (RTS PC    PRINTW MOV #20,COUNTW ;sub to print 16 of the 7 bit columns (CLR BSHIFT  LOOPW MOV HADD,WADD ;WADD is mem address of word getting bit from  JSR PC,PACKR1 ;pack 7 bit column into reg 1 (JSR PC,PRINT1 ;send contents of reg 1 to printer (CMP ETX,R1 ;if byte sent was 3 (ETX), send another ETX (BNE NOTETX ; (single ETX MAIN MOV (SP)+,RETURN ;pull return address from the stack (MOV (SP)+,BASE ;pull screen memory address from is control char) (JSR PC,PRETX ; (double ETX is interpreted as graphics 3)  NOTETX INC BSHIFT ;bshif the stack (MOV BASE,VBASE ;VBASE is the mem addr for 7th row of bits (ADD #360,VBASE (JSR PC,PRINTP ;print is the bit position in the word (DEC COUNTW (BNE LOOPW (RTS PC    PACKR1 CLR R1 ;sub to pack 7 bit ct full page (screen) (MOV RETURN,-(SP) ;put return address on stack (RTS PC ;and return (   PRINTPolumn into reg 1 (MOV #7,VCOUNT ;vcount is bit position in 7 bit column  MOV #42,COUNTP ;sub to print full screen - 34 rows of 7 bits (MOV VBASE,JADD ;JADD is the mem address of st LOOPPR ASL R1 ;shift reg 1 to make room for next bit of col (JSR PC,MASKB ;get proper bit from wL  ;position of desired bit in word  COUNTP .WORD ;counter for the 40 rows in a screen (page)  COUNTR .WORD ;counter for the 20 words in a 320 bit row  COUNTW .WORD ;counter for the 16 bits in a word  ETX .WORD 3 ;ASCII ETX  HADD .WORD ;mem address of word with bit 7 of 7 bit col  JADD .WORD ;mem address of start of row of 7 bit cols  MASK .WORD 177776 ;mask to dEC VCOUNT (BNE LOOPPR (RTS PC ( (  MASKB MOV @WADD,R0 ;sub to select bit in word by masking (MOV BSHIFT,BCOUNelete all but bit 0  RETURN .WORD ;return address  STX .WORD 2 ;ASCII STX T ; -- the word is loaded into reg 0,  LOOPBS BEQ ENDBS ; rotated until bit desired is bit 0, (ASR R0  VBASE .WORD ;mem address for 7th row of bits on screen  VCOUNT .WORD ;counter for posi ; and all other bits masked off (DEC BCOUNT (JMP LOOPBS  ENDBS BIC MASK,R0 (RTS PC    PRETX MOVtion on 7 bit column  VT .WORD 13 ;ASCII VT  WADD .WORD ;mem address for word with bi ETX,R1 ;sub to print ETX (JSR PC,PRINT1 (RTS PC ( (  PRSTX MOV STX,R1 ;sub to print STX (JSR t to extract  WCOUNT .WORD ;counter for time delay sub  WTIME .WORD 500 ;cycles to wait forPC,PRINT1 (RTS PC ( (  PRVT MOV VT,R1 ;sub to print VT (JSR PC,PRINT1 (RTS PC ( (  PRINT1 BIT #200,@X handshaking signal  XDB .WORD 177520+6 ;address of status reg  XSR .WORD 177520+4 ;address of the pSR ;sub to send a byte to the printer (BEQ PRINT1 ;wait for finished sending last byte rint reg  (.END (  LOOP2 BIT #100000,@XSR ;wait for printer ready - pin 19 on printer (BEQ LOOP2 (MOV R1,@XDB ;send to print reg (RTS PC    WAITT MOV WTIME,WCOUNT  LOOPWA DEC WCOUNT (BNE LOOPWA (RTS PC (   BASE .WORD  ;mem address for start of screen  BCOUNT .WORD ;position of desired bit in word  BSHIFT .WORD