Home » Archimedes archive » Micro User » MU 1992-05.adf » PD » Fractal/!Fractal/Asm/Sample

Fractal/!Fractal/Asm/Sample

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Micro User » MU 1992-05.adf » PD
Filename: Fractal/!Fractal/Asm/Sample
Read OK:
File size: 0E79 bytes
Load address: 0000
Exec address: 0000
File contents
   10REM > <Frac$Dir>.Asm.Sample
   20REM Sample Assembler source for !Fractal driver
   30REM After assembling change the !RUN file for !Fractal to
   40REM RUN <Frac$Dir>.Fractal -a Sample
   50LIBRARY "<Frac$Dir>.Asm.Fraclib":PROCfracvars
   60LIBRARY "<Frac$Dir>.Asm.FPlib":PROCfpinit
   70circle=0:varstart=0:varend=0:REM initialise to a dummy value
   80DIM code% 4096
   90FOR asm=4 TO 7 STEP 3
  100P%=0:O%=code%
  110[OPT asm
  120; Following is the list of fractal functions in this module
  130FNfrachdr ; Identify ourselves as a fractal module
  140;
  150; One or more function definition pointers follow
  160DCD circle_func ; The CIRCLE function definition
  170;
  180DCD -1 ; End of functions
  190;--------------------------------------------------------------
  200; Now we define the CIRCLE function's characteristics
  210;
  220.circle_func FNfracfunc("Circle",circle,fZoom,0,5,varend-varstart)
  230;
  240; CIRCLE's Variables after here
  250.varstart
  260FNafg2var(AFG_dbl,0,8):.x0 FNfp("DFD 0")
  270FNafg2var(AFG_dbl,0,8):.y0 FNfp("DFD 0")
  280FNafg2var(AFG_dbl,0,8):.w FNfp("DFD 1280")
  290FNafg2var(AFG_dbl,0,8):.h FNfp("DFD 1024")
  300FNafg2var(AFG_str,0,12)
  310EQUS "Test String"+CHR$0:ALIGN ; Sample string - note CHR$0 & ALIGN at end
  320.varend ; End of variables
  330;
  340; Variable names after here - 1 for each variable above
  350FNvarname("         x0")
  360FNvarname("         y0")
  370FNvarname("      width")
  380FNvarname("     height")
  390FNvarname("     String")
  400;-------------------------------------
  410; The entry point to CIRCLE
  420.circle
  430FNfenter ; Initialise
  440; R0=Fractal Event, R1=Address of Data
  450MOV R9,#0
  460STR R9,[R1,#fevent_rc] ; clear return code
  470CMP R0,#fplotinit
  480BEQ plotinit
  490CMP R0,#fplot
  500BEQ plot
  510CMP R0,#fdatainit
  520BEQ datainit
  530; Unsupported event - just return
  540FNfexit
  550;-------------------------------------
  560; Initialise ready for a plot
  570.plotinit
  580SWI 256+18 ; GCOL
  590SWI 256+0
  600SWI 256+63 ; Use colour 63 (white)
  610; Calculate OS units conversion factors
  620FNfp("LDFD F0,w")
  630FNfp("LDFD F1,iw")
  640FNfp("DVFD F2,F1,F0") ; Magnification
  650LDR R2,[R1,#plot_im_osx]
  660FNfp("FLTD F3,R2")
  670FNfp("DVFD F3,F3,F1") ; Internal units->OS units scalar
  680FNfp("MUFD F3,F3,F2") ; mag.*scalar=total scalar
  690FNfp("STFD F3,scalar")
  700; Calculate and set graphics origin
  710FNfp("LDFD F0,x0")
  720FNfp("MUFD F0,F0,F3") ; x0 to OS units
  730FNfp("MNFD F0,F0") ; Negate
  740FNfp("FIXD R2,F0")
  750FNfp("LDFD F0,y0")
  760FNfp("MUFD F0,F0,F3") ; y0 to OS units
  770FNfp("MNFD F0,F0") ; Negate
  780FNfp("FIXD R3,F0")
  790SWI 256+29 ; Graphics origin
  800AND R0,R2,#&FF  ; Low byte
  810SWI "OS_WriteC"
  820MOV R0,R2,LSR #8 ; Hi byte
  830SWI "OS_WriteC"
  840AND R0,R3,#&FF  ; Low byte
  850SWI "OS_WriteC"
  860MOV R0,R3,LSR #8 ; Hi byte
  870SWI "OS_WriteC"
  880; Exit
  890FNfexit
  900
  910.scalar FNfp("DFD 0")
  920.ix FNfp("DFD 0") ; Initial values
  930.iy FNfp("DFD 0")
  940.iw FNfp("DFD 1280")
  950.ih FNfp("DFD 1024")
  960
  970; Plot routine
  980.plot
  990MVN R0,#0 ;R0=-1
 1000STR R0,[R1,#plot_rc] ; Set end of plot ready for exit
 1010FNfp("LDFD F0,xm")
 1020FNfp("LDFD F1,ym")
 1030FNfp("LDFD F2,r")
 1040FNfp("LDFD F3,scalar")
 1050FNfp("MUFD F4,F0,F3")
 1060FNfp("FIXD R1,F4") ; x
 1070FNfp("MUFD F4,F1,F3")
 1080FNfp("FIXD R2,F4") ; y
 1090MOV R0,#4 ; Move
 1100SWI "OS_Plot"
 1110MOV R0,#149 ; Circle outline
 1120MOV R1,R1,LSR #1
 1130MOV R2,R2,LSR #1
 1140SWI "OS_Plot"
 1150FNfexit
 1160
 1170.xm FNfp("DFD 640") ; centre
 1180.ym FNfp("DFD 512")
 1190.r FNfp("DFD 320") ; radius
 1200
 1210; Init data
 1220.datainit
 1230FNfp("LDFD F0,ix")
 1240FNfp("STFD F0,x0")
 1250FNfp("LDFD F0,iy")
 1260FNfp("STFD F0,y0")
 1270FNfp("LDFD F0,iw")
 1280FNfp("STFD F0,w ")
 1290FNfp("LDFD F0,ih")
 1300FNfp("STFD F0,h ")
 1310FNfexit
 1320;--------------------------
 1330FNfinterface ; Necessary C Interface code
 1340]:NEXT
 1350SYS "OS_File",10,"<Frac$Dir>.Sample",&FFA,,code%,O%
 1360END

� > <Frac$Dir>.Asm.Sample
1� Sample Assembler source for !Fractal driver
;� After assembling change the !RUN file for !Fractal to
(&� RUN <Frac$Dir>.Fractal -a Sample
2)ț "<Frac$Dir>.Asm.Fraclib":�fracvars
<%ț "<Frac$Dir>.Asm.FPlib":�fpinit
F>circle=0:varstart=0:varend=0:� initialise to a dummy value
P� code% 4096
Z� asm=4 � 7 � 3
dP%=0:O%=code%
n[OPT asm
x?; Following is the list of fractal functions in this module
�5�frachdr ; Identify ourselves as a fractal module
�;
�5; One or more function definition pointers follow
�0DCD circle_func ; The ȏ function definition
�;
�DCD -1 ; End of functions
�C;--------------------------------------------------------------
�5; Now we define the ȏ function's characteristics
�;
�E.circle_func �fracfunc("Circle",circle,fZoom,0,5,varend-varstart)
�;
�; ȏ's Variables after here
�
.varstart
*�afg2var(AFG_dbl,0,8):.x0 �fp("DFD 0")
*�afg2var(AFG_dbl,0,8):.y0 �fp("DFD 0")
,�afg2var(AFG_dbl,0,8):.w �fp("DFD 1280")
",�afg2var(AFG_dbl,0,8):.h �fp("DFD 1024")
,�afg2var(AFG_str,0,12)
6HEQUS "Test String"+�0:ALIGN ; Sample string - note �0 & ALIGN at end
@.varend ; End of variables
J;
T;; Variable names after here - 1 for each variable above
^�varname("         x0")
h�varname("         y0")
r�varname("      width")
|�varname("     height")
��varname("     String")
�*;-------------------------------------
�; The entry point to ȏ
�.circle
��fenter ; Initialise
�*; R0=Fractal Event, R1=Address of Data
�
MOV R9,#0
�.STR R9,[R1,#fevent_rc] ; clear return code
�CMP R0,#fplotinit
�BEQ plotinit
�CMP R0,#fplot
�BEQ plot
�CMP R0,#fdatainit
BEQ datainit
%; Unsupported event - just return

�fexit
&*;-------------------------------------
0!; Initialise ready for a plot
:
.plotinit
DSWI 256+18 ; �
N
SWI 256+0
X&SWI 256+63 ; Use colour 63 (white)
b+; Calculate OS units conversion factors
l�fp("LDFD F0,w")
v�fp("LDFD F1,iw")
�(�fp("DVFD F2,F1,F0") ; Magnification
�LDR R2,[R1,#plot_im_osx]
��fp("FLTD F3,R2")
�:�fp("DVFD F3,F3,F1") ; Internal units->OS units scalar
�3�fp("MUFD F3,F3,F2") ; mag.*scalar=total scalar
��fp("STFD F3,scalar")
�'; Calculate and set graphics origin
��fp("LDFD F0,x0")
�)�fp("MUFD F0,F0,F3") ; x0 to OS units
��fp("MNFD F0,F0") ; Negate
��fp("FIXD R2,F0")
��fp("LDFD F0,y0")
�)�fp("MUFD F0,F0,F3") ; y0 to OS units
�fp("MNFD F0,F0") ; Negate
�fp("FIXD R3,F0")
 SWI 256+29 ; Graphics origin
 � R0,R2,#&FF  ; Low byte
*SWI "OS_WriteC"
4MOV R0,R2,LSR #8 ; Hi byte
>SWI "OS_WriteC"
H� R0,R3,#&FF  ; Low byte
RSWI "OS_WriteC"
\MOV R0,R3,LSR #8 ; Hi byte
fSWI "OS_WriteC"
p
; Exit
z
�fexit
�
�.scalar �fp("DFD 0")
�%.ix �fp("DFD 0") ; Initial values
�.iy �fp("DFD 0")
�.iw �fp("DFD 1280")
�.ih �fp("DFD 1024")
�
�; Plot routine
�	.plot
�MVN R0,#0 ;R0=-1
�9STR R0,[R1,#plot_rc] ; Set end of plot ready for exit
��fp("LDFD F0,xm")
��fp("LDFD F1,ym")
�fp("LDFD F2,r")
�fp("LDFD F3,scalar")
�fp("MUFD F4,F0,F3")
$�fp("FIXD R1,F4") ; x
.�fp("MUFD F4,F1,F3")
8�fp("FIXD R2,F4") ; y
BMOV R0,#4 ; Move
LSWI "OS_Plot"
V MOV R0,#149 ; Circle outline
`MOV R1,R1,LSR #1
jMOV R2,R2,LSR #1
tSWI "OS_Plot"
~
�fexit
�
�.xm �fp("DFD 640") ; centre
�.ym �fp("DFD 512")
�.r �fp("DFD 320") ; radius
�
�; Init data
�
.datainit
��fp("LDFD F0,ix")
��fp("STFD F0,x0")
��fp("LDFD F0,iy")
��fp("STFD F0,y0")
��fp("LDFD F0,iw")
�fp("STFD F0,w ")

�fp("LDFD F0,ih")
�fp("STFD F0,h ")

�fexit
(;--------------------------
2,�finterface ; Necessary C Interface code
<]:�
F6ș "OS_File",10,"<Frac$Dir>.Sample",&FFA,,code%,O%
P�
�
00000000  0d 00 0a 1d f4 20 3e 20  3c 46 72 61 63 24 44 69  |..... > <Frac$Di|
00000010  72 3e 2e 41 73 6d 2e 53  61 6d 70 6c 65 0d 00 14  |r>.Asm.Sample...|
00000020  31 f4 20 53 61 6d 70 6c  65 20 41 73 73 65 6d 62  |1. Sample Assemb|
00000030  6c 65 72 20 73 6f 75 72  63 65 20 66 6f 72 20 21  |ler source for !|
00000040  46 72 61 63 74 61 6c 20  64 72 69 76 65 72 0d 00  |Fractal driver..|
00000050  1e 3b f4 20 41 66 74 65  72 20 61 73 73 65 6d 62  |.;. After assemb|
00000060  6c 69 6e 67 20 63 68 61  6e 67 65 20 74 68 65 20  |ling change the |
00000070  21 52 55 4e 20 66 69 6c  65 20 66 6f 72 20 21 46  |!RUN file for !F|
00000080  72 61 63 74 61 6c 20 74  6f 0d 00 28 26 f4 20 52  |ractal to..(&. R|
00000090  55 4e 20 3c 46 72 61 63  24 44 69 72 3e 2e 46 72  |UN <Frac$Dir>.Fr|
000000a0  61 63 74 61 6c 20 2d 61  20 53 61 6d 70 6c 65 0d  |actal -a Sample.|
000000b0  00 32 29 c8 9b 20 22 3c  46 72 61 63 24 44 69 72  |.2).. "<Frac$Dir|
000000c0  3e 2e 41 73 6d 2e 46 72  61 63 6c 69 62 22 3a f2  |>.Asm.Fraclib":.|
000000d0  66 72 61 63 76 61 72 73  0d 00 3c 25 c8 9b 20 22  |fracvars..<%.. "|
000000e0  3c 46 72 61 63 24 44 69  72 3e 2e 41 73 6d 2e 46  |<Frac$Dir>.Asm.F|
000000f0  50 6c 69 62 22 3a f2 66  70 69 6e 69 74 0d 00 46  |Plib":.fpinit..F|
00000100  3e 63 69 72 63 6c 65 3d  30 3a 76 61 72 73 74 61  |>circle=0:varsta|
00000110  72 74 3d 30 3a 76 61 72  65 6e 64 3d 30 3a f4 20  |rt=0:varend=0:. |
00000120  69 6e 69 74 69 61 6c 69  73 65 20 74 6f 20 61 20  |initialise to a |
00000130  64 75 6d 6d 79 20 76 61  6c 75 65 0d 00 50 10 de  |dummy value..P..|
00000140  20 63 6f 64 65 25 20 34  30 39 36 0d 00 5a 13 e3  | code% 4096..Z..|
00000150  20 61 73 6d 3d 34 20 b8  20 37 20 88 20 33 0d 00  | asm=4 . 7 . 3..|
00000160  64 11 50 25 3d 30 3a 4f  25 3d 63 6f 64 65 25 0d  |d.P%=0:O%=code%.|
00000170  00 6e 0c 5b 4f 50 54 20  61 73 6d 0d 00 78 3f 3b  |.n.[OPT asm..x?;|
00000180  20 46 6f 6c 6c 6f 77 69  6e 67 20 69 73 20 74 68  | Following is th|
00000190  65 20 6c 69 73 74 20 6f  66 20 66 72 61 63 74 61  |e list of fracta|
000001a0  6c 20 66 75 6e 63 74 69  6f 6e 73 20 69 6e 20 74  |l functions in t|
000001b0  68 69 73 20 6d 6f 64 75  6c 65 0d 00 82 35 a4 66  |his module...5.f|
000001c0  72 61 63 68 64 72 20 3b  20 49 64 65 6e 74 69 66  |rachdr ; Identif|
000001d0  79 20 6f 75 72 73 65 6c  76 65 73 20 61 73 20 61  |y ourselves as a|
000001e0  20 66 72 61 63 74 61 6c  20 6d 6f 64 75 6c 65 0d  | fractal module.|
000001f0  00 8c 05 3b 0d 00 96 35  3b 20 4f 6e 65 20 6f 72  |...;...5; One or|
00000200  20 6d 6f 72 65 20 66 75  6e 63 74 69 6f 6e 20 64  | more function d|
00000210  65 66 69 6e 69 74 69 6f  6e 20 70 6f 69 6e 74 65  |efinition pointe|
00000220  72 73 20 66 6f 6c 6c 6f  77 0d 00 a0 30 44 43 44  |rs follow...0DCD|
00000230  20 63 69 72 63 6c 65 5f  66 75 6e 63 20 3b 20 54  | circle_func ; T|
00000240  68 65 20 c8 8f 20 66 75  6e 63 74 69 6f 6e 20 64  |he .. function d|
00000250  65 66 69 6e 69 74 69 6f  6e 0d 00 aa 05 3b 0d 00  |efinition....;..|
00000260  b4 1d 44 43 44 20 2d 31  20 3b 20 45 6e 64 20 6f  |..DCD -1 ; End o|
00000270  66 20 66 75 6e 63 74 69  6f 6e 73 0d 00 be 43 3b  |f functions...C;|
00000280  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
000002b0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 00  |--------------..|
000002c0  c8 35 3b 20 4e 6f 77 20  77 65 20 64 65 66 69 6e  |.5; Now we defin|
000002d0  65 20 74 68 65 20 c8 8f  20 66 75 6e 63 74 69 6f  |e the .. functio|
000002e0  6e 27 73 20 63 68 61 72  61 63 74 65 72 69 73 74  |n's characterist|
000002f0  69 63 73 0d 00 d2 05 3b  0d 00 dc 45 2e 63 69 72  |ics....;...E.cir|
00000300  63 6c 65 5f 66 75 6e 63  20 a4 66 72 61 63 66 75  |cle_func .fracfu|
00000310  6e 63 28 22 43 69 72 63  6c 65 22 2c 63 69 72 63  |nc("Circle",circ|
00000320  6c 65 2c 66 5a 6f 6f 6d  2c 30 2c 35 2c 76 61 72  |le,fZoom,0,5,var|
00000330  65 6e 64 2d 76 61 72 73  74 61 72 74 29 0d 00 e6  |end-varstart)...|
00000340  05 3b 0d 00 f0 1f 3b 20  c8 8f 27 73 20 56 61 72  |.;....; ..'s Var|
00000350  69 61 62 6c 65 73 20 61  66 74 65 72 20 68 65 72  |iables after her|
00000360  65 0d 00 fa 0d 2e 76 61  72 73 74 61 72 74 0d 01  |e.....varstart..|
00000370  04 2a a4 61 66 67 32 76  61 72 28 41 46 47 5f 64  |.*.afg2var(AFG_d|
00000380  62 6c 2c 30 2c 38 29 3a  2e 78 30 20 a4 66 70 28  |bl,0,8):.x0 .fp(|
00000390  22 44 46 44 20 30 22 29  0d 01 0e 2a a4 61 66 67  |"DFD 0")...*.afg|
000003a0  32 76 61 72 28 41 46 47  5f 64 62 6c 2c 30 2c 38  |2var(AFG_dbl,0,8|
000003b0  29 3a 2e 79 30 20 a4 66  70 28 22 44 46 44 20 30  |):.y0 .fp("DFD 0|
000003c0  22 29 0d 01 18 2c a4 61  66 67 32 76 61 72 28 41  |")...,.afg2var(A|
000003d0  46 47 5f 64 62 6c 2c 30  2c 38 29 3a 2e 77 20 a4  |FG_dbl,0,8):.w .|
000003e0  66 70 28 22 44 46 44 20  31 32 38 30 22 29 0d 01  |fp("DFD 1280")..|
000003f0  22 2c a4 61 66 67 32 76  61 72 28 41 46 47 5f 64  |",.afg2var(AFG_d|
00000400  62 6c 2c 30 2c 38 29 3a  2e 68 20 a4 66 70 28 22  |bl,0,8):.h .fp("|
00000410  44 46 44 20 31 30 32 34  22 29 0d 01 2c 1a a4 61  |DFD 1024")..,..a|
00000420  66 67 32 76 61 72 28 41  46 47 5f 73 74 72 2c 30  |fg2var(AFG_str,0|
00000430  2c 31 32 29 0d 01 36 48  45 51 55 53 20 22 54 65  |,12)..6HEQUS "Te|
00000440  73 74 20 53 74 72 69 6e  67 22 2b bd 30 3a 41 4c  |st String"+.0:AL|
00000450  49 47 4e 20 3b 20 53 61  6d 70 6c 65 20 73 74 72  |IGN ; Sample str|
00000460  69 6e 67 20 2d 20 6e 6f  74 65 20 bd 30 20 26 20  |ing - note .0 & |
00000470  41 4c 49 47 4e 20 61 74  20 65 6e 64 0d 01 40 1e  |ALIGN at end..@.|
00000480  2e 76 61 72 65 6e 64 20  3b 20 45 6e 64 20 6f 66  |.varend ; End of|
00000490  20 76 61 72 69 61 62 6c  65 73 0d 01 4a 05 3b 0d  | variables..J.;.|
000004a0  01 54 3b 3b 20 56 61 72  69 61 62 6c 65 20 6e 61  |.T;; Variable na|
000004b0  6d 65 73 20 61 66 74 65  72 20 68 65 72 65 20 2d  |mes after here -|
000004c0  20 31 20 66 6f 72 20 65  61 63 68 20 76 61 72 69  | 1 for each vari|
000004d0  61 62 6c 65 20 61 62 6f  76 65 0d 01 5e 1b a4 76  |able above..^..v|
000004e0  61 72 6e 61 6d 65 28 22  20 20 20 20 20 20 20 20  |arname("        |
000004f0  20 78 30 22 29 0d 01 68  1b a4 76 61 72 6e 61 6d  | x0")..h..varnam|
00000500  65 28 22 20 20 20 20 20  20 20 20 20 79 30 22 29  |e("         y0")|
00000510  0d 01 72 1b a4 76 61 72  6e 61 6d 65 28 22 20 20  |..r..varname("  |
00000520  20 20 20 20 77 69 64 74  68 22 29 0d 01 7c 1b a4  |    width")..|..|
00000530  76 61 72 6e 61 6d 65 28  22 20 20 20 20 20 68 65  |varname("     he|
00000540  69 67 68 74 22 29 0d 01  86 1b a4 76 61 72 6e 61  |ight").....varna|
00000550  6d 65 28 22 20 20 20 20  20 53 74 72 69 6e 67 22  |me("     String"|
00000560  29 0d 01 90 2a 3b 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |)...*;----------|
00000570  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000580  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 0d 01 9a 1b 3b  |-----------....;|
00000590  20 54 68 65 20 65 6e 74  72 79 20 70 6f 69 6e 74  | The entry point|
000005a0  20 74 6f 20 c8 8f 0d 01  a4 0b 2e 63 69 72 63 6c  | to .......circl|
000005b0  65 0d 01 ae 18 a4 66 65  6e 74 65 72 20 3b 20 49  |e.....fenter ; I|
000005c0  6e 69 74 69 61 6c 69 73  65 0d 01 b8 2a 3b 20 52  |nitialise...*; R|
000005d0  30 3d 46 72 61 63 74 61  6c 20 45 76 65 6e 74 2c  |0=Fractal Event,|
000005e0  20 52 31 3d 41 64 64 72  65 73 73 20 6f 66 20 44  | R1=Address of D|
000005f0  61 74 61 0d 01 c2 0d 4d  4f 56 20 52 39 2c 23 30  |ata....MOV R9,#0|
00000600  0d 01 cc 2e 53 54 52 20  52 39 2c 5b 52 31 2c 23  |....STR R9,[R1,#|
00000610  66 65 76 65 6e 74 5f 72  63 5d 20 3b 20 63 6c 65  |fevent_rc] ; cle|
00000620  61 72 20 72 65 74 75 72  6e 20 63 6f 64 65 0d 01  |ar return code..|
00000630  d6 15 43 4d 50 20 52 30  2c 23 66 70 6c 6f 74 69  |..CMP R0,#fploti|
00000640  6e 69 74 0d 01 e0 10 42  45 51 20 70 6c 6f 74 69  |nit....BEQ ploti|
00000650  6e 69 74 0d 01 ea 11 43  4d 50 20 52 30 2c 23 66  |nit....CMP R0,#f|
00000660  70 6c 6f 74 0d 01 f4 0c  42 45 51 20 70 6c 6f 74  |plot....BEQ plot|
00000670  0d 01 fe 15 43 4d 50 20  52 30 2c 23 66 64 61 74  |....CMP R0,#fdat|
00000680  61 69 6e 69 74 0d 02 08  10 42 45 51 20 64 61 74  |ainit....BEQ dat|
00000690  61 69 6e 69 74 0d 02 12  25 3b 20 55 6e 73 75 70  |ainit...%; Unsup|
000006a0  70 6f 72 74 65 64 20 65  76 65 6e 74 20 2d 20 6a  |ported event - j|
000006b0  75 73 74 20 72 65 74 75  72 6e 0d 02 1c 0a a4 66  |ust return.....f|
000006c0  65 78 69 74 0d 02 26 2a  3b 2d 2d 2d 2d 2d 2d 2d  |exit..&*;-------|
000006d0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000006e0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 0d 02  |--------------..|
000006f0  30 21 3b 20 49 6e 69 74  69 61 6c 69 73 65 20 72  |0!; Initialise r|
00000700  65 61 64 79 20 66 6f 72  20 61 20 70 6c 6f 74 0d  |eady for a plot.|
00000710  02 3a 0d 2e 70 6c 6f 74  69 6e 69 74 0d 02 44 12  |.:..plotinit..D.|
00000720  53 57 49 20 32 35 36 2b  31 38 20 3b 20 e6 0d 02  |SWI 256+18 ; ...|
00000730  4e 0d 53 57 49 20 32 35  36 2b 30 0d 02 58 26 53  |N.SWI 256+0..X&S|
00000740  57 49 20 32 35 36 2b 36  33 20 3b 20 55 73 65 20  |WI 256+63 ; Use |
00000750  63 6f 6c 6f 75 72 20 36  33 20 28 77 68 69 74 65  |colour 63 (white|
00000760  29 0d 02 62 2b 3b 20 43  61 6c 63 75 6c 61 74 65  |)..b+; Calculate|
00000770  20 4f 53 20 75 6e 69 74  73 20 63 6f 6e 76 65 72  | OS units conver|
00000780  73 69 6f 6e 20 66 61 63  74 6f 72 73 0d 02 6c 14  |sion factors..l.|
00000790  a4 66 70 28 22 4c 44 46  44 20 46 30 2c 77 22 29  |.fp("LDFD F0,w")|
000007a0  0d 02 76 15 a4 66 70 28  22 4c 44 46 44 20 46 31  |..v..fp("LDFD F1|
000007b0  2c 69 77 22 29 0d 02 80  28 a4 66 70 28 22 44 56  |,iw")...(.fp("DV|
000007c0  46 44 20 46 32 2c 46 31  2c 46 30 22 29 20 3b 20  |FD F2,F1,F0") ; |
000007d0  4d 61 67 6e 69 66 69 63  61 74 69 6f 6e 0d 02 8a  |Magnification...|
000007e0  1c 4c 44 52 20 52 32 2c  5b 52 31 2c 23 70 6c 6f  |.LDR R2,[R1,#plo|
000007f0  74 5f 69 6d 5f 6f 73 78  5d 0d 02 94 15 a4 66 70  |t_im_osx].....fp|
00000800  28 22 46 4c 54 44 20 46  33 2c 52 32 22 29 0d 02  |("FLTD F3,R2")..|
00000810  9e 3a a4 66 70 28 22 44  56 46 44 20 46 33 2c 46  |.:.fp("DVFD F3,F|
00000820  33 2c 46 31 22 29 20 3b  20 49 6e 74 65 72 6e 61  |3,F1") ; Interna|
00000830  6c 20 75 6e 69 74 73 2d  3e 4f 53 20 75 6e 69 74  |l units->OS unit|
00000840  73 20 73 63 61 6c 61 72  0d 02 a8 33 a4 66 70 28  |s scalar...3.fp(|
00000850  22 4d 55 46 44 20 46 33  2c 46 33 2c 46 32 22 29  |"MUFD F3,F3,F2")|
00000860  20 3b 20 6d 61 67 2e 2a  73 63 61 6c 61 72 3d 74  | ; mag.*scalar=t|
00000870  6f 74 61 6c 20 73 63 61  6c 61 72 0d 02 b2 19 a4  |otal scalar.....|
00000880  66 70 28 22 53 54 46 44  20 46 33 2c 73 63 61 6c  |fp("STFD F3,scal|
00000890  61 72 22 29 0d 02 bc 27  3b 20 43 61 6c 63 75 6c  |ar")...'; Calcul|
000008a0  61 74 65 20 61 6e 64 20  73 65 74 20 67 72 61 70  |ate and set grap|
000008b0  68 69 63 73 20 6f 72 69  67 69 6e 0d 02 c6 15 a4  |hics origin.....|
000008c0  66 70 28 22 4c 44 46 44  20 46 30 2c 78 30 22 29  |fp("LDFD F0,x0")|
000008d0  0d 02 d0 29 a4 66 70 28  22 4d 55 46 44 20 46 30  |...).fp("MUFD F0|
000008e0  2c 46 30 2c 46 33 22 29  20 3b 20 78 30 20 74 6f  |,F0,F3") ; x0 to|
000008f0  20 4f 53 20 75 6e 69 74  73 0d 02 da 1e a4 66 70  | OS units.....fp|
00000900  28 22 4d 4e 46 44 20 46  30 2c 46 30 22 29 20 3b  |("MNFD F0,F0") ;|
00000910  20 4e 65 67 61 74 65 0d  02 e4 15 a4 66 70 28 22  | Negate.....fp("|
00000920  46 49 58 44 20 52 32 2c  46 30 22 29 0d 02 ee 15  |FIXD R2,F0")....|
00000930  a4 66 70 28 22 4c 44 46  44 20 46 30 2c 79 30 22  |.fp("LDFD F0,y0"|
00000940  29 0d 02 f8 29 a4 66 70  28 22 4d 55 46 44 20 46  |)...).fp("MUFD F|
00000950  30 2c 46 30 2c 46 33 22  29 20 3b 20 79 30 20 74  |0,F0,F3") ; y0 t|
00000960  6f 20 4f 53 20 75 6e 69  74 73 0d 03 02 1e a4 66  |o OS units.....f|
00000970  70 28 22 4d 4e 46 44 20  46 30 2c 46 30 22 29 20  |p("MNFD F0,F0") |
00000980  3b 20 4e 65 67 61 74 65  0d 03 0c 15 a4 66 70 28  |; Negate.....fp(|
00000990  22 46 49 58 44 20 52 33  2c 46 30 22 29 0d 03 16  |"FIXD R3,F0")...|
000009a0  20 53 57 49 20 32 35 36  2b 32 39 20 3b 20 47 72  | SWI 256+29 ; Gr|
000009b0  61 70 68 69 63 73 20 6f  72 69 67 69 6e 0d 03 20  |aphics origin.. |
000009c0  1c 80 20 52 30 2c 52 32  2c 23 26 46 46 20 20 3b  |.. R0,R2,#&FF  ;|
000009d0  20 4c 6f 77 20 62 79 74  65 0d 03 2a 13 53 57 49  | Low byte..*.SWI|
000009e0  20 22 4f 53 5f 57 72 69  74 65 43 22 0d 03 34 1e  | "OS_WriteC"..4.|
000009f0  4d 4f 56 20 52 30 2c 52  32 2c 4c 53 52 20 23 38  |MOV R0,R2,LSR #8|
00000a00  20 3b 20 48 69 20 62 79  74 65 0d 03 3e 13 53 57  | ; Hi byte..>.SW|
00000a10  49 20 22 4f 53 5f 57 72  69 74 65 43 22 0d 03 48  |I "OS_WriteC"..H|
00000a20  1c 80 20 52 30 2c 52 33  2c 23 26 46 46 20 20 3b  |.. R0,R3,#&FF  ;|
00000a30  20 4c 6f 77 20 62 79 74  65 0d 03 52 13 53 57 49  | Low byte..R.SWI|
00000a40  20 22 4f 53 5f 57 72 69  74 65 43 22 0d 03 5c 1e  | "OS_WriteC"..\.|
00000a50  4d 4f 56 20 52 30 2c 52  33 2c 4c 53 52 20 23 38  |MOV R0,R3,LSR #8|
00000a60  20 3b 20 48 69 20 62 79  74 65 0d 03 66 13 53 57  | ; Hi byte..f.SW|
00000a70  49 20 22 4f 53 5f 57 72  69 74 65 43 22 0d 03 70  |I "OS_WriteC"..p|
00000a80  0a 3b 20 45 78 69 74 0d  03 7a 0a a4 66 65 78 69  |.; Exit..z..fexi|
00000a90  74 0d 03 84 04 0d 03 8e  18 2e 73 63 61 6c 61 72  |t.........scalar|
00000aa0  20 a4 66 70 28 22 44 46  44 20 30 22 29 0d 03 98  | .fp("DFD 0")...|
00000ab0  25 2e 69 78 20 a4 66 70  28 22 44 46 44 20 30 22  |%.ix .fp("DFD 0"|
00000ac0  29 20 3b 20 49 6e 69 74  69 61 6c 20 76 61 6c 75  |) ; Initial valu|
00000ad0  65 73 0d 03 a2 14 2e 69  79 20 a4 66 70 28 22 44  |es.....iy .fp("D|
00000ae0  46 44 20 30 22 29 0d 03  ac 17 2e 69 77 20 a4 66  |FD 0").....iw .f|
00000af0  70 28 22 44 46 44 20 31  32 38 30 22 29 0d 03 b6  |p("DFD 1280")...|
00000b00  17 2e 69 68 20 a4 66 70  28 22 44 46 44 20 31 30  |..ih .fp("DFD 10|
00000b10  32 34 22 29 0d 03 c0 04  0d 03 ca 12 3b 20 50 6c  |24")........; Pl|
00000b20  6f 74 20 72 6f 75 74 69  6e 65 0d 03 d4 09 2e 70  |ot routine.....p|
00000b30  6c 6f 74 0d 03 de 14 4d  56 4e 20 52 30 2c 23 30  |lot....MVN R0,#0|
00000b40  20 3b 52 30 3d 2d 31 0d  03 e8 39 53 54 52 20 52  | ;R0=-1...9STR R|
00000b50  30 2c 5b 52 31 2c 23 70  6c 6f 74 5f 72 63 5d 20  |0,[R1,#plot_rc] |
00000b60  3b 20 53 65 74 20 65 6e  64 20 6f 66 20 70 6c 6f  |; Set end of plo|
00000b70  74 20 72 65 61 64 79 20  66 6f 72 20 65 78 69 74  |t ready for exit|
00000b80  0d 03 f2 15 a4 66 70 28  22 4c 44 46 44 20 46 30  |.....fp("LDFD F0|
00000b90  2c 78 6d 22 29 0d 03 fc  15 a4 66 70 28 22 4c 44  |,xm").....fp("LD|
00000ba0  46 44 20 46 31 2c 79 6d  22 29 0d 04 06 14 a4 66  |FD F1,ym").....f|
00000bb0  70 28 22 4c 44 46 44 20  46 32 2c 72 22 29 0d 04  |p("LDFD F2,r")..|
00000bc0  10 19 a4 66 70 28 22 4c  44 46 44 20 46 33 2c 73  |...fp("LDFD F3,s|
00000bd0  63 61 6c 61 72 22 29 0d  04 1a 18 a4 66 70 28 22  |calar").....fp("|
00000be0  4d 55 46 44 20 46 34 2c  46 30 2c 46 33 22 29 0d  |MUFD F4,F0,F3").|
00000bf0  04 24 19 a4 66 70 28 22  46 49 58 44 20 52 31 2c  |.$..fp("FIXD R1,|
00000c00  46 34 22 29 20 3b 20 78  0d 04 2e 18 a4 66 70 28  |F4") ; x.....fp(|
00000c10  22 4d 55 46 44 20 46 34  2c 46 31 2c 46 33 22 29  |"MUFD F4,F1,F3")|
00000c20  0d 04 38 19 a4 66 70 28  22 46 49 58 44 20 52 32  |..8..fp("FIXD R2|
00000c30  2c 46 34 22 29 20 3b 20  79 0d 04 42 14 4d 4f 56  |,F4") ; y..B.MOV|
00000c40  20 52 30 2c 23 34 20 3b  20 4d 6f 76 65 0d 04 4c  | R0,#4 ; Move..L|
00000c50  11 53 57 49 20 22 4f 53  5f 50 6c 6f 74 22 0d 04  |.SWI "OS_Plot"..|
00000c60  56 20 4d 4f 56 20 52 30  2c 23 31 34 39 20 3b 20  |V MOV R0,#149 ; |
00000c70  43 69 72 63 6c 65 20 6f  75 74 6c 69 6e 65 0d 04  |Circle outline..|
00000c80  60 14 4d 4f 56 20 52 31  2c 52 31 2c 4c 53 52 20  |`.MOV R1,R1,LSR |
00000c90  23 31 0d 04 6a 14 4d 4f  56 20 52 32 2c 52 32 2c  |#1..j.MOV R2,R2,|
00000ca0  4c 53 52 20 23 31 0d 04  74 11 53 57 49 20 22 4f  |LSR #1..t.SWI "O|
00000cb0  53 5f 50 6c 6f 74 22 0d  04 7e 0a a4 66 65 78 69  |S_Plot"..~..fexi|
00000cc0  74 0d 04 88 04 0d 04 92  1f 2e 78 6d 20 a4 66 70  |t.........xm .fp|
00000cd0  28 22 44 46 44 20 36 34  30 22 29 20 3b 20 63 65  |("DFD 640") ; ce|
00000ce0  6e 74 72 65 0d 04 9c 16  2e 79 6d 20 a4 66 70 28  |ntre.....ym .fp(|
00000cf0  22 44 46 44 20 35 31 32  22 29 0d 04 a6 1e 2e 72  |"DFD 512").....r|
00000d00  20 a4 66 70 28 22 44 46  44 20 33 32 30 22 29 20  | .fp("DFD 320") |
00000d10  3b 20 72 61 64 69 75 73  0d 04 b0 04 0d 04 ba 0f  |; radius........|
00000d20  3b 20 49 6e 69 74 20 64  61 74 61 0d 04 c4 0d 2e  |; Init data.....|
00000d30  64 61 74 61 69 6e 69 74  0d 04 ce 15 a4 66 70 28  |datainit.....fp(|
00000d40  22 4c 44 46 44 20 46 30  2c 69 78 22 29 0d 04 d8  |"LDFD F0,ix")...|
00000d50  15 a4 66 70 28 22 53 54  46 44 20 46 30 2c 78 30  |..fp("STFD F0,x0|
00000d60  22 29 0d 04 e2 15 a4 66  70 28 22 4c 44 46 44 20  |").....fp("LDFD |
00000d70  46 30 2c 69 79 22 29 0d  04 ec 15 a4 66 70 28 22  |F0,iy").....fp("|
00000d80  53 54 46 44 20 46 30 2c  79 30 22 29 0d 04 f6 15  |STFD F0,y0")....|
00000d90  a4 66 70 28 22 4c 44 46  44 20 46 30 2c 69 77 22  |.fp("LDFD F0,iw"|
00000da0  29 0d 05 00 15 a4 66 70  28 22 53 54 46 44 20 46  |).....fp("STFD F|
00000db0  30 2c 77 20 22 29 0d 05  0a 15 a4 66 70 28 22 4c  |0,w ").....fp("L|
00000dc0  44 46 44 20 46 30 2c 69  68 22 29 0d 05 14 15 a4  |DFD F0,ih").....|
00000dd0  66 70 28 22 53 54 46 44  20 46 30 2c 68 20 22 29  |fp("STFD F0,h ")|
00000de0  0d 05 1e 0a a4 66 65 78  69 74 0d 05 28 1f 3b 2d  |.....fexit..(.;-|
00000df0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000e00  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 05 32 2c a4 66 69  |---------..2,.fi|
00000e10  6e 74 65 72 66 61 63 65  20 3b 20 4e 65 63 65 73  |nterface ; Neces|
00000e20  73 61 72 79 20 43 20 49  6e 74 65 72 66 61 63 65  |sary C Interface|
00000e30  20 63 6f 64 65 0d 05 3c  07 5d 3a ed 0d 05 46 36  | code..<.]:...F6|
00000e40  c8 99 20 22 4f 53 5f 46  69 6c 65 22 2c 31 30 2c  |.. "OS_File",10,|
00000e50  22 3c 46 72 61 63 24 44  69 72 3e 2e 53 61 6d 70  |"<Frac$Dir>.Samp|
00000e60  6c 65 22 2c 26 46 46 41  2c 2c 63 6f 64 65 25 2c  |le",&FFA,,code%,|
00000e70  4f 25 0d 05 50 05 e0 0d  ff                       |O%..P....|
00000e79