Home » CEEFAX disks » telesoftware6.adl » 09-04-88/B\OSB21

09-04-88/B\OSB21

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 » CEEFAX disks » telesoftware6.adl
Filename: 09-04-88/B\OSB21
Read OK:
File size: 2472 bytes
Load address: FFFF0E00
Exec address: FFFF802B
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
   10REM OSbits Module B/osb21
   20REM Mandelbrot set by Fixed Point Arithmetic
   30REM Version 1.4 26.4.87
   40 
   50REM  Use OSBYTE 234 to detect a second processor
   60X%=0
   70Y%=&FF
   80A%=234
   90R%=USR(&FFF4) AND &FF00
  100IF R%>0 THEN DIM code% &300 ELSE code%=&1300
  110IF R%=0 THEN MODE 7 ELSE *KEY0CALL code%|M
  120IF R%=0 THEN *KEY0NEW|MCALL &1300|MOLD|M
  130IF R%>0 THEN PRINT "Assembling in 2nd Processor" ELSE PRINT "Assembling in I/O processor"
  140 
  150*KEY1MO.3|M|NL.|M
  160 
  170oswrch = &FFEE
  180 
  190mode = 2
  200x_step = 8
  210y_step = 4
  220iterations = 32
  230size_limit = 4
  240 
  250REM  Set zero page workspace for the multiplying routine
  260 
  270multiplicand = &70
  280ppws = &75
  290multiplier= &7A
  300fxp_res = &7C
  310 
  320FOR pass% = 0 TO 2 STEP 2
  330P% = code%
  340 
  350[OPT pass%
  360 
  370\  Code to set up the calculations
  380 
  390LDA #22               \ Set screen mode
  400JSR oswrch
  410LDA #mode
  420JSR oswrch
  430 
  440LDA #5                \ VDU5
  450JSR oswrch
  460 
  470LDA #0                \ Clear x_coord
  480STA x_coord
  490STA x_coord+1
  500 
  510.x_loop               \ Loop to draw horizontally
  520 
  530LDA #0                \ Clear y_coord
  540STA y_coord
  550STA y_coord+1
  560 
  570.y_loop               \ Loop to draw vertically
  580 
  590JSR mandelbrot
  600 
  610LDA #25               \ PLOT 69 equivalent - plot a point
  620JSR oswrch
  630LDA #69
  640JSR oswrch
  650LDA x_coord
  660JSR oswrch
  670LDA x_coord+1
  680JSR oswrch
  690LDA y_coord
  700JSR oswrch
  710LDA y_coord+1
  720JSR oswrch
  730 
  740LDA y_coord
  750CLC
  760ADC #y_step
  770STA y_coord           \ Add y_step to current y_coord
  780LDA y_coord+1
  790ADC #0
  800STA y_coord+1
  810CMP #4                \ Check if we have exceeded 1023 (&3FF)
  820BNE y_loop
  830 
  840LDA x_coord
  850CLC
  860ADC #x_step
  870STA x_coord           \ Add x_step to current x_coord
  880LDA x_coord+1
  890ADC #0
  900STA x_coord+1
  910CMP #4                \ Check if we have exceeded 1023 (&3FF)
  920BNE x_loop
  930 
  940RTS
  950 
  960.mandelbrot
  970 
  980\  For each screen point we compute how many iterations of
  990\  z=z^2+c (where z and c are complex) it takes for |z| to
 1000\  exceed 2 with a limit of 32 iterations in total
 1010\  The Mandelbrot set exists within these bounds -
 1020\  Real = -2.25 to 0.75  Imaginary = -1.5 to 1.5
 1030\  Thus .... h_inc=v_inc=3/1024 which is &C0 in our fixed point
 1040 
 1050\  First compute value of c_real (=real(low)+x_coord*h_inc)
 1060 
 1070LDX #4
 1080 
 1090.transfer_hinc_loop   \ Move h_inc into multiplicand
 1100 
 1110LDA h_inc-1, X        \ Offset from address-1 so we can use BNE
 1120STA multiplicand-1, X
 1130DEX
 1140BNE transfer_hinc_loop
 1150 
 1160LDA x_coord           \ Move x_coord into multiplier
 1170STA multiplier+2
 1180LDA x_coord+1
 1190STA multiplier+3
 1200JSR fixed_point_mult
 1210 
 1220LDX #4
 1230 
 1240.transfer_creal_loop
 1250 
 1260LDA fxp_res-1, X
 1270STA c_real-1, X
 1280DEX
 1290BNE transfer_creal_loop
 1300 
 1310LDA #&C0              \ Add -2.25, = &FFFDC000 in fixed point
 1320CLC
 1330ADC c_real+1
 1340STA c_real+1
 1350LDA #&FD
 1360ADC c_real+2
 1370STA c_real+2
 1380LDA #&FF
 1390ADC c_real+3
 1400STA c_real+3
 1410 
 1420\  Then compute value of c_imag (=imag(low)+y_coord*v_inc)
 1430 
 1440LDX #4
 1450 
 1460.transfer_vinc_loop
 1470 
 1480LDA v_inc-1, X
 1490STA multiplicand-1, X
 1500DEX
 1510BNE transfer_vinc_loop
 1520 
 1530LDA y_coord
 1540STA multiplier+2
 1550LDA y_coord+1
 1560STA multiplier+3
 1570JSR fixed_point_mult
 1580 
 1590LDX #4
 1600 
 1610.transfer_cimag_loop
 1620 
 1630LDA fxp_res-1, X
 1640STA c_imag-1, X
 1650DEX
 1660BNE transfer_cimag_loop
 1670 
 1680LDA #&80              \ Add -1.5 = &FFFE800 in fixed point
 1690CLC
 1700ADC c_imag+1
 1710STA c_imag+1
 1720LDA #&FE
 1730ADC c_imag+2
 1740STA c_imag+2
 1750LDA #&FF
 1760ADC c_imag+3
 1770STA c_imag+3
 1780 
 1790LDA #iterations       \ Initialise iterations counter
 1800STA count
 1810LDA #0
 1820LDX #4
 1830 
 1840.reset_xy_loop        \ Clear x y work space
 1850 
 1860STA x-1, X
 1870STA y-1, X
 1880DEX
 1890BNE reset_xy_loop
 1900 
 1910.mandelbrot_loop      \ Main loop performs iterations
 1920 
 1930\  Get squares of x and y by putting x into both multiplicand
 1940\  and multiplier and calling the fixed point multiply
 1950\  routine.  Store in space labelled x_squared and repeat for y
 1960 
 1970LDX #4
 1980 
 1990.x_square_prepare_loop
 2000 
 2010LDA x-1, X
 2020STA multiplicand-1, X
 2030STA multiplier-1, X
 2040DEX
 2050BNE x_square_prepare_loop
 2060 
 2070JSR fixed_point_mult
 2080 
 2090LDX #4
 2100 
 2110.x_square_recover_loop
 2120 
 2130LDA fxp_res-1, X
 2140STA x_squared-1, X
 2150DEX
 2160BNE x_square_recover_loop
 2170LDX #4
 2180 
 2190.y_square_prepare_loop
 2200 
 2210LDA y-1, X
 2220STA multiplicand-1, X
 2230STA multiplier-1, X
 2240DEX
 2250BNE y_square_prepare_loop
 2260 
 2270JSR fixed_point_mult
 2280 
 2290LDX #4
 2300 
 2310.y_square_recover_loop
 2320 
 2330LDA fxp_res-1, X
 2340STA y_squared-1, X
 2350DEX
 2360BNE y_square_recover_loop
 2370 
 2380\  Now calculate size (= x_squared+y_squared)
 2390 
 2400CLC
 2410LDA x_squared
 2420ADC y_squared
 2430STA size
 2440LDA x_squared+1
 2450ADC y_squared+1
 2460STA size+1
 2470LDA x_squared+2
 2480ADC y_squared+2
 2490STA size+2
 2500LDA x_squared+3
 2510ADC y_squared+3
 2520STA size+3
 2530 
 2540\  New y is 2*x*y+c_imag
 2550 
 2560LDX #4
 2570 
 2580.transfer_xy_for_mult
 2590 
 2600LDA x-1, X
 2610STA multiplier-1, X
 2620LDA y-1, X
 2630STA multiplicand-1, X
 2640DEX
 2650BNE transfer_xy_for_mult
 2660 
 2670JSR fixed_point_mult
 2680 
 2690LDX #4
 2700 
 2710.transfer_xy_after_mult
 2720 
 2730LDA fxp_res-1, X
 2740STA y-1, X
 2750DEX
 2760BNE transfer_xy_after_mult
 2770 
 2780\  Multiply by 2 (i.e. a shift left)
 2790 
 2800ASL y
 2810ROL y+1
 2820ROL y+2
 2830ROL y+3
 2840 
 2850\  Trap for size by checking byte 2 of fixed point word
 2860\  Done in odd place to optimise branch length
 2870 
 2880LDA size+2
 2890CMP #size_limit
 2900BCS size_out
 2910 
 2920\  Returning to y calculation - Add c_imag
 2930 
 2940CLC
 2950LDA y
 2960ADC c_imag
 2970STA y
 2980LDA y+1
 2990ADC c_imag+1
 3000STA y+1
 3010LDA y+2
 3020ADC c_imag+2
 3030STA y+2
 3040LDA y+3
 3050ADC c_imag+3
 3060STA y+3
 3070 
 3080\  New value of x is x_squared-y_squared+c_real
 3090 
 3100SEC
 3110LDA x_squared
 3120SBC y_squared
 3130STA x
 3140LDA x_squared+1
 3150SBC y_squared+1
 3160STA x+1
 3170LDA x_squared+2
 3180SBC y_squared+2
 3190STA x+2
 3200LDA x_squared+3
 3210SBC y_squared+3
 3220STA x+3
 3230 
 3240CLC
 3250LDA x
 3260ADC c_real
 3270STA x
 3280LDA x+1
 3290ADC c_real+1
 3300STA x+1
 3310LDA x+2
 3320ADC c_real+2
 3330STA x+2
 3340LDA x+3
 3350ADC c_real+3
 3360STA x+3
 3370 
 3380\  Trap for maximum number of iterations allowed
 3390 
 3400DEC count
 3410BEQ count_out
 3420 
 3430JMP mandelbrot_loop
 3440 
 3450.size_out             \ If size exceeds limit pixel is coloured
 3460 
 3470LDA #18
 3480JSR oswrch
 3490LDA #0
 3500JSR oswrch
 3510LDA count
 3520AND #7                \ Gives values from 0 to 7
 3530JSR oswrch
 3540RTS
 3550 
 3560.count_out            \ If we reach iterations limit then pixel is black
 3570 
 3580LDA #18               \ GCOL
 3590JSR oswrch
 3600LDA #0
 3610JSR oswrch
 3620JSR oswrch
 3630RTS
 3640 
 3650.x_coord   OPT   FNEQUW(0)
 3660.y_coord   OPT   FNEQUW(0)
 3670.c_real    OPT   FNEQUD(0)
 3680.c_imag    OPT   FNEQUD(0)
 3690.count     OPT   FNEQUB(0)
 3700.size      OPT   FNEQUD(0)
 3710.x         OPT   FNEQUD(0)
 3720.y         OPT   FNEQUD(0)
 3730.x_squared OPT   FNEQUD(0)
 3740.y_squared OPT   FNEQUD(0)
 3750.h_inc     OPT   FNEQUD(&C0)
 3760.v_inc     OPT   FNEQUD(&C0)
 3770 
 3780.fixed_point_mult
 3790 
 3800\  Assumes that numbers to be multiplied are put into
 3810\  multiplicand and multiplier.  ppws is used for
 3820\  partial product. Result is put into multiplier but
 3830\  read from 'multiplier +2' ('fxp_res') for fixed point
 3840\  Workspace is in zero page from &70 so the labels are
 3850\  set using BASIC at the start of the assembler
 3860 
 3870LDA #0
 3880STA ppws              \ Clear partial product workspace
 3890STA ppws+1
 3900STA ppws+2
 3910STA ppws+3
 3920STA ppws+4
 3930STA multiplier+4
 3940STA multiplicand+4
 3950STA multiplier+5
 3960 
 3970LDA multiplier+3      \ Test multiplier for negative
 3980BPL multiplier_pos
 3990DEC multiplier+4      \ Make top byte = &FF
 4000 
 4010.multiplier_pos
 4020 
 4030LDA multiplicand+3    \ Repeat for multiplicand
 4040BPL multiplicand_pos
 4050DEC multiplicand+4
 4060 
 4070.multiplicand_pos
 4080 
 4090LDX #40               \ Carry out 40 times for 40 bit arithmetic
 4100 
 4110LSR multiplier+4
 4120ROR multiplier+3
 4130ROR multiplier+2
 4140ROR multiplier+1
 4150ROR multiplier
 4160 
 4170.fxpm_loop
 4180 
 4190BCC no_add_fxpm       \ Is next bit of multiplier set?
 4200CLC
 4210LDA multiplicand      \ Add multiplicand
 4220ADC ppws
 4230STA ppws
 4240LDA multiplicand+1
 4250ADC ppws+1
 4260STA ppws+1
 4270LDA multiplicand+2
 4280ADC ppws+2
 4290STA ppws+2
 4300LDA multiplicand+3
 4310ADC ppws+3
 4320STA ppws+3
 4330LDA multiplicand+4
 4340ADC ppws+4
 4350STA ppws+4
 4360 
 4370.no_add_fxpm
 4380 
 4390LSR ppws+4            \ Rotate (shift) ppws & multiplier right
 4400ROR ppws+3
 4410ROR ppws+2
 4420ROR ppws+1
 4430ROR ppws
 4440ROR multiplier+4
 4450ROR multiplier+3
 4460ROR multiplier+2
 4470ROR multiplier+1
 4480ROR multiplier
 4490DEX                   \ Counting down from 32 to zero
 4500BNE fxpm_loop
 4510 
 4520LDA multiplier+4
 4530BPL res_pos
 4540DEC multiplier+5
 4550 
 4560.res_pos
 4570 
 4580RTS
 4590 
 4600]
 4610NEXT
 4620PRINT"Assembly complete, press f0 to execute."
 4630END
 4640 
 4650**** EQUate a Byte ****
 4660DEF FNEQUB(N%)
 4670?P%=N% MOD 256
 4680IF (pass% AND 3) = 3 THEN PRINT ~?P%
 4690P%=P%+1
 4700=pass%
 4710 
 4720**** EQUate a Word (2 bytes) ****
 4730DEF FNEQUW(N%)
 4740?P%=N% MOD 256
 4750P%?1=N% DIV 256
 4760IF (pass% AND 3) = 3 THEN PRINT ~?P%,~?(P%+1)
 4770P%=P%+2
 4780=pass%
 4790 
 4800**** EQUate a Double word (4 bytes) ****
 4810DEF FNEQUD(N%)
 4820LOCAL X%
 4830!P%=N%
 4840FOR X%=0 TO 3
 4850IF (pass% AND 3) = 3 THEN PRINT ~P%?X%;
 4860NEXT
 4870IF (pass% AND 3) = 3 THEN PRINT
 4880P%=P%+4
 4890=pass%

� OSbits Module B/osb21
.� Mandelbrot set by Fixed Point Arithmetic
� Version 1.4 26.4.87
( 
22�  Use OSBYTE 234 to detect a second processor
<X%=0
F
Y%=&FF
P
A%=234
ZR%=�(&FFF4) � &FF00
d'� R%>0 � � code% &300 � code%=&1300
n$� R%=0 � � 7 � *KEY0CALL code%|M
x(� R%=0 � *KEY0NEW|MCALL &1300|MOLD|M
�N� R%>0 � � "Assembling in 2nd Processor" � � "Assembling in I/O processor"
� 
�*KEY1MO.3|M|NL.|M
� 
�oswrch = &FFEE
� 
�mode = 2
�x_step = 8
�y_step = 4
�iterations = 32
�size_limit = 4
� 
�:�  Set zero page workspace for the multiplying routine
 
multiplicand = &70
ppws = &75
"multiplier= &7A
,fxp_res = &7C
6 
@� pass% = 0 � 2 � 2
JP% = code%
T 
^[OPT pass%
h 
r&\  Code to set up the calculations
| 
�+LDA #22               \ Set screen mode
�JSR oswrch
�
LDA #mode
�JSR oswrch
� 
�LDA #5                \ �5
�JSR oswrch
� 
�)LDA #0                \ Clear x_coord
�STA x_coord
�STA x_coord+1
� 
�5.x_loop               \ Loop to draw horizontally
 
)LDA #0                \ Clear y_coord
STA y_coord
&STA y_coord+1
0 
:3.y_loop               \ Loop to draw vertically
D 
NJSR mandelbrot
X 
b:LDA #25               \ � 69 equivalent - plot a point
lJSR oswrch
vLDA #69
�JSR oswrch
�LDA x_coord
�JSR oswrch
�LDA x_coord+1
�JSR oswrch
�LDA y_coord
�JSR oswrch
�LDA y_coord+1
�JSR oswrch
� 
�LDA y_coord
�CLC
�ADC #y_step
9STA y_coord           \ Add y_step to current y_coord
LDA y_coord+1

ADC #0
 STA y_coord+1
*ACMP #4                \ Check if we have exceeded 1023 (&3FF)
4BNE y_loop
> 
HLDA x_coord
RCLC
\ADC #x_step
f9STA x_coord           \ Add x_step to current x_coord
pLDA x_coord+1
z
ADC #0
�STA x_coord+1
�ACMP #4                \ Check if we have exceeded 1023 (&3FF)
�BNE x_loop
� 
�RTS
� 
�.mandelbrot
� 
�>\  For each screen point we compute how many iterations of
�>\  z=z^2+c (where z and c are complex) it takes for |z| to
�6\  exceed 2 with a limit of 32 iterations in total
�6\  The Mandelbrot set exists within these bounds -
�4\  Real = -2.25 to 0.75  Imaginary = -1.5 to 1.5
C\  Thus .... h_inc=v_inc=3/1024 which is &C0 in our fixed point
 
?\  First compute value of c_real (=real(low)+x_coord*h_inc)
$ 
.
LDX #4
8 
B8.transfer_hinc_loop   \ Move h_inc into multiplicand
L 
VCLDA h_inc-1, X        \ Offset from address-1 so we can use BNE
`STA multiplicand-1, X
jDEX
tBNE transfer_hinc_loop
~ 
�8LDA x_coord           \ Move x_coord into multiplier
�STA multiplier+2
�LDA x_coord+1
�STA multiplier+3
�JSR fixed_point_mult
� 
�
LDX #4
� 
�.transfer_creal_loop
� 
�LDA fxp_res-1, X
�STA c_real-1, X
DEX

BNE transfer_creal_loop
 
ALDA #&C0              \ Add -2.25, = &FFFDC000 in fixed point
(CLC
2ADC c_real+1
<STA c_real+1
FLDA #&FD
PADC c_real+2
ZSTA c_real+2
dLDA #&FF
nADC c_real+3
xSTA c_real+3
� 
�>\  Then compute value of c_imag (=imag(low)+y_coord*v_inc)
� 
�
LDX #4
� 
�.transfer_vinc_loop
� 
�LDA v_inc-1, X
�STA multiplicand-1, X
�DEX
�BNE transfer_vinc_loop
� 
�LDA y_coord
STA multiplier+2
LDA y_coord+1
STA multiplier+3
"JSR fixed_point_mult
, 
6
LDX #4
@ 
J.transfer_cimag_loop
T 
^LDA fxp_res-1, X
hSTA c_imag-1, X
rDEX
|BNE transfer_cimag_loop
� 
�>LDA #&80              \ Add -1.5 = &FFFE800 in fixed point
�CLC
�ADC c_imag+1
�STA c_imag+1
�LDA #&FE
�ADC c_imag+2
�STA c_imag+2
�LDA #&FF
�ADC c_imag+3
�STA c_imag+3
� 
�9LDA #iterations       \ Initialise iterations counter

STA count

LDA #0

LDX #4
& 
00.reset_xy_loop        \ Clear x y work space
: 
DSTA x-1, X
NSTA y-1, X
XDEX
bBNE reset_xy_loop
l 
v9.mandelbrot_loop      \ Main loop performs iterations
� 
�A\  Get squares of x and y by putting x into both multiplicand
�:\  and multiplier and calling the fixed point multiply
�C\  routine.  Store in space labelled x_squared and repeat for y
� 
�
LDX #4
� 
�.x_square_prepare_loop
� 
�LDA x-1, X
�STA multiplicand-1, X
�STA multiplier-1, X
�DEX
BNE x_square_prepare_loop
 
JSR fixed_point_mult
  
*
LDX #4
4 
>.x_square_recover_loop
H 
RLDA fxp_res-1, X
\STA x_squared-1, X
fDEX
pBNE x_square_recover_loop
z
LDX #4
� 
�.y_square_prepare_loop
� 
�LDA y-1, X
�STA multiplicand-1, X
�STA multiplier-1, X
�DEX
�BNE y_square_prepare_loop
� 
�JSR fixed_point_mult
� 
�
LDX #4
� 
	.y_square_recover_loop
	 
	LDA fxp_res-1, X
	$STA y_squared-1, X
	.DEX
	8BNE y_square_recover_loop
	B 
	L1\  Now calculate size (= x_squared+y_squared)
	V 
	`CLC
	jLDA x_squared
	tADC y_squared
	~STA size
	�LDA x_squared+1
	�ADC y_squared+1
	�STA size+1
	�LDA x_squared+2
	�ADC y_squared+2
	�STA size+2
	�LDA x_squared+3
	�ADC y_squared+3
	�STA size+3
	� 
	�\  New y is 2*x*y+c_imag
	� 

LDX #4

 
.transfer_xy_for_mult
 
(LDA x-1, X
2STA multiplier-1, X
<LDA y-1, X
FSTA multiplicand-1, X
PDEX
ZBNE transfer_xy_for_mult
d 
nJSR fixed_point_mult
x 
�
LDX #4
� 
�.transfer_xy_after_mult
� 
�LDA fxp_res-1, X
�STA y-1, X
�DEX
�BNE transfer_xy_after_mult
� 
�(\  Multiply by 2 (i.e. a shift left)
� 
�	ASL y
�ROL y+1
ROL y+2
ROL y+3
 
";\  Trap for size by checking byte 2 of fixed point word
,2\  Done in odd place to optimise branch length
6 
@LDA size+2
JCMP #size_limit
TBCS size_out
^ 
h.\  Returning to y calculation - Add c_imag
r 
|CLC
�	LDA y
�ADC c_imag
�	STA y
�LDA y+1
�ADC c_imag+1
�STA y+1
�LDA y+2
�ADC c_imag+2
�STA y+2
�LDA y+3
�ADC c_imag+3
�STA y+3
� 
3\  New value of x is x_squared-y_squared+c_real
 
SEC
&LDA x_squared
0SBC y_squared
:	STA x
DLDA x_squared+1
NSBC y_squared+1
XSTA x+1
bLDA x_squared+2
lSBC y_squared+2
vSTA x+2
�LDA x_squared+3
�SBC y_squared+3
�STA x+3
� 
�CLC
�	LDA x
�ADC c_real
�	STA x
�LDA x+1
�ADC c_real+1
�STA x+1
�LDA x+2
�ADC c_real+2

STA x+2

LDA x+3

ADC c_real+3

 STA x+3

* 

44\  Trap for maximum number of iterations allowed

> 

H
DEC count

RBEQ count_out

\ 

fJMP mandelbrot_loop

p 

zC.size_out             \ If size exceeds limit pixel is coloured

� 

�LDA #18

�JSR oswrch

�
LDA #0

�JSR oswrch

�
LDA count

�2� #7                \ Gives values from 0 to 7

�JSR oswrch

�RTS

� 

�L.count_out            \ If we reach iterations limit then pixel is black

� 

�LDA #18               \ �
JSR oswrch

LDA #0
JSR oswrch
$JSR oswrch
.RTS
8 
B.x_coord   OPT   �EQUW(0)
L.y_coord   OPT   �EQUW(0)
V.c_real    OPT   �EQUD(0)
`.c_imag    OPT   �EQUD(0)
j.count     OPT   �EQUB(0)
t.size      OPT   �EQUD(0)
~.x         OPT   �EQUD(0)
�.y         OPT   �EQUD(0)
�.x_squared OPT   �EQUD(0)
�.y_squared OPT   �EQUD(0)
�.h_inc     OPT   �EQUD(&C0)
�.v_inc     OPT   �EQUD(&C0)
� 
�.fixed_point_mult
� 
�9\  Assumes that numbers to be multiplied are put into
�5\  multiplicand and multiplier.  ppws is used for
�9\  partial product. Result is put into multiplier but
�<\  read from 'multiplier +2' ('fxp_res') for fixed point
;\  Workspace is in zero page from &70 so the labels are

4\  set using BASIC at the start of the assembler
 

LDA #0
(;STA ppws              \ Clear partial product workspace
2STA ppws+1
<STA ppws+2
FSTA ppws+3
PSTA ppws+4
ZSTA multiplier+4
dSTA multiplicand+4
nSTA multiplier+5
x 
�8LDA multiplier+3      \ Test multiplier for negative
�BPL multiplier_pos
�/DEC multiplier+4      \ Make top byte = &FF
� 
�.multiplier_pos
� 
�3LDA multiplicand+3    \ Repeat for multiplicand
�BPL multiplicand_pos
�DEC multiplicand+4
� 
�.multiplicand_pos
� 
�DLDX #40               \ Carry out 40 times for 40 bit arithmetic
 
LSR multiplier+4
ROR multiplier+3
"ROR multiplier+2
,ROR multiplier+1
6ROR multiplier
@ 
J.fxpm_loop
T 
^:BCC no_add_fxpm       \ Is next bit of multiplier set?
hCLC
r,LDA multiplicand      \ Add multiplicand
|ADC ppws
�STA ppws
�LDA multiplicand+1
�ADC ppws+1
�STA ppws+1
�LDA multiplicand+2
�ADC ppws+2
�STA ppws+2
�LDA multiplicand+3
�ADC ppws+3
�STA ppws+3
�LDA multiplicand+4
�ADC ppws+4
�STA ppws+4
 
.no_add_fxpm
 
&BLSR ppws+4            \ Rotate (shift) ppws & multiplier right
0ROR ppws+3
:ROR ppws+2
DROR ppws+1
NROR ppws
XROR multiplier+4
bROR multiplier+3
lROR multiplier+2
vROR multiplier+1
�ROR multiplier
�9DEX                   \ Counting down from 32 to zero
�BNE fxpm_loop
� 
�LDA multiplier+4
�BPL res_pos
�DEC multiplier+5
� 
�.res_pos
� 
�RTS
� 
�]
�
.�"Assembly complete, press f0 to execute."
�
  
***** EQUate a Byte ****
4� �EQUB(N%)
>?P%=N% � 256
H� (pass% � 3) = 3 � � ~?P%
RP%=P%+1
\
=pass%
f 
p%**** EQUate a Word (2 bytes) ****
z� �EQUW(N%)
�?P%=N% � 256
�P%?1=N% � 256
�'� (pass% � 3) = 3 � � ~?P%,~?(P%+1)
�P%=P%+2
�
=pass%
� 
�,**** EQUate a Double word (4 bytes) ****
�� �EQUD(N%)
�� X%
�
!P%=N%
�� X%=0 � 3
�!� (pass% � 3) = 3 � � ~P%?X%;
��
� (pass% � 3) = 3 � �
P%=P%+4

=pass%
�
00000000  0d 00 0a 1b f4 20 4f 53  62 69 74 73 20 4d 6f 64  |..... OSbits Mod|
00000010  75 6c 65 20 42 2f 6f 73  62 32 31 0d 00 14 2e f4  |ule B/osb21.....|
00000020  20 4d 61 6e 64 65 6c 62  72 6f 74 20 73 65 74 20  | Mandelbrot set |
00000030  62 79 20 46 69 78 65 64  20 50 6f 69 6e 74 20 41  |by Fixed Point A|
00000040  72 69 74 68 6d 65 74 69  63 0d 00 1e 19 f4 20 56  |rithmetic..... V|
00000050  65 72 73 69 6f 6e 20 31  2e 34 20 32 36 2e 34 2e  |ersion 1.4 26.4.|
00000060  38 37 0d 00 28 05 20 0d  00 32 32 f4 20 20 55 73  |87..(. ..22.  Us|
00000070  65 20 4f 53 42 59 54 45  20 32 33 34 20 74 6f 20  |e OSBYTE 234 to |
00000080  64 65 74 65 63 74 20 61  20 73 65 63 6f 6e 64 20  |detect a second |
00000090  70 72 6f 63 65 73 73 6f  72 0d 00 3c 08 58 25 3d  |processor..<.X%=|
000000a0  30 0d 00 46 0a 59 25 3d  26 46 46 0d 00 50 0a 41  |0..F.Y%=&FF..P.A|
000000b0  25 3d 32 33 34 0d 00 5a  17 52 25 3d ba 28 26 46  |%=234..Z.R%=.(&F|
000000c0  46 46 34 29 20 80 20 26  46 46 30 30 0d 00 64 27  |FF4) . &FF00..d'|
000000d0  e7 20 52 25 3e 30 20 8c  20 de 20 63 6f 64 65 25  |. R%>0 . . code%|
000000e0  20 26 33 30 30 20 8b 20  63 6f 64 65 25 3d 26 31  | &300 . code%=&1|
000000f0  33 30 30 0d 00 6e 24 e7  20 52 25 3d 30 20 8c 20  |300..n$. R%=0 . |
00000100  eb 20 37 20 8b 20 2a 4b  45 59 30 43 41 4c 4c 20  |. 7 . *KEY0CALL |
00000110  63 6f 64 65 25 7c 4d 0d  00 78 28 e7 20 52 25 3d  |code%|M..x(. R%=|
00000120  30 20 8c 20 2a 4b 45 59  30 4e 45 57 7c 4d 43 41  |0 . *KEY0NEW|MCA|
00000130  4c 4c 20 26 31 33 30 30  7c 4d 4f 4c 44 7c 4d 0d  |LL &1300|MOLD|M.|
00000140  00 82 4e e7 20 52 25 3e  30 20 8c 20 f1 20 22 41  |..N. R%>0 . . "A|
00000150  73 73 65 6d 62 6c 69 6e  67 20 69 6e 20 32 6e 64  |ssembling in 2nd|
00000160  20 50 72 6f 63 65 73 73  6f 72 22 20 8b 20 f1 20  | Processor" . . |
00000170  22 41 73 73 65 6d 62 6c  69 6e 67 20 69 6e 20 49  |"Assembling in I|
00000180  2f 4f 20 70 72 6f 63 65  73 73 6f 72 22 0d 00 8c  |/O processor"...|
00000190  05 20 0d 00 96 15 2a 4b  45 59 31 4d 4f 2e 33 7c  |. ....*KEY1MO.3||
000001a0  4d 7c 4e 4c 2e 7c 4d 0d  00 a0 05 20 0d 00 aa 12  |M|NL.|M.... ....|
000001b0  6f 73 77 72 63 68 20 3d  20 26 46 46 45 45 0d 00  |oswrch = &FFEE..|
000001c0  b4 05 20 0d 00 be 0c 6d  6f 64 65 20 3d 20 32 0d  |.. ....mode = 2.|
000001d0  00 c8 0e 78 5f 73 74 65  70 20 3d 20 38 0d 00 d2  |...x_step = 8...|
000001e0  0e 79 5f 73 74 65 70 20  3d 20 34 0d 00 dc 13 69  |.y_step = 4....i|
000001f0  74 65 72 61 74 69 6f 6e  73 20 3d 20 33 32 0d 00  |terations = 32..|
00000200  e6 12 73 69 7a 65 5f 6c  69 6d 69 74 20 3d 20 34  |..size_limit = 4|
00000210  0d 00 f0 05 20 0d 00 fa  3a f4 20 20 53 65 74 20  |.... ...:.  Set |
00000220  7a 65 72 6f 20 70 61 67  65 20 77 6f 72 6b 73 70  |zero page worksp|
00000230  61 63 65 20 66 6f 72 20  74 68 65 20 6d 75 6c 74  |ace for the mult|
00000240  69 70 6c 79 69 6e 67 20  72 6f 75 74 69 6e 65 0d  |iplying routine.|
00000250  01 04 05 20 0d 01 0e 16  6d 75 6c 74 69 70 6c 69  |... ....multipli|
00000260  63 61 6e 64 20 3d 20 26  37 30 0d 01 18 0e 70 70  |cand = &70....pp|
00000270  77 73 20 3d 20 26 37 35  0d 01 22 13 6d 75 6c 74  |ws = &75..".mult|
00000280  69 70 6c 69 65 72 3d 20  26 37 41 0d 01 2c 11 66  |iplier= &7A..,.f|
00000290  78 70 5f 72 65 73 20 3d  20 26 37 43 0d 01 36 05  |xp_res = &7C..6.|
000002a0  20 0d 01 40 17 e3 20 70  61 73 73 25 20 3d 20 30  | ..@.. pass% = 0|
000002b0  20 b8 20 32 20 88 20 32  0d 01 4a 0e 50 25 20 3d  | . 2 . 2..J.P% =|
000002c0  20 63 6f 64 65 25 0d 01  54 05 20 0d 01 5e 0e 5b  | code%..T. ..^.[|
000002d0  4f 50 54 20 70 61 73 73  25 0d 01 68 05 20 0d 01  |OPT pass%..h. ..|
000002e0  72 26 5c 20 20 43 6f 64  65 20 74 6f 20 73 65 74  |r&\  Code to set|
000002f0  20 75 70 20 74 68 65 20  63 61 6c 63 75 6c 61 74  | up the calculat|
00000300  69 6f 6e 73 0d 01 7c 05  20 0d 01 86 2b 4c 44 41  |ions..|. ...+LDA|
00000310  20 23 32 32 20 20 20 20  20 20 20 20 20 20 20 20  | #22            |
00000320  20 20 20 5c 20 53 65 74  20 73 63 72 65 65 6e 20  |   \ Set screen |
00000330  6d 6f 64 65 0d 01 90 0e  4a 53 52 20 6f 73 77 72  |mode....JSR oswr|
00000340  63 68 0d 01 9a 0d 4c 44  41 20 23 6d 6f 64 65 0d  |ch....LDA #mode.|
00000350  01 a4 0e 4a 53 52 20 6f  73 77 72 63 68 0d 01 ae  |...JSR oswrch...|
00000360  05 20 0d 01 b8 1e 4c 44  41 20 23 35 20 20 20 20  |. ....LDA #5    |
00000370  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 ef 35  |            \ .5|
00000380  0d 01 c2 0e 4a 53 52 20  6f 73 77 72 63 68 0d 01  |....JSR oswrch..|
00000390  cc 05 20 0d 01 d6 29 4c  44 41 20 23 30 20 20 20  |.. ...)LDA #0   |
000003a0  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 43  |             \ C|
000003b0  6c 65 61 72 20 78 5f 63  6f 6f 72 64 0d 01 e0 0f  |lear x_coord....|
000003c0  53 54 41 20 78 5f 63 6f  6f 72 64 0d 01 ea 11 53  |STA x_coord....S|
000003d0  54 41 20 78 5f 63 6f 6f  72 64 2b 31 0d 01 f4 05  |TA x_coord+1....|
000003e0  20 0d 01 fe 35 2e 78 5f  6c 6f 6f 70 20 20 20 20  | ...5.x_loop    |
000003f0  20 20 20 20 20 20 20 20  20 20 20 5c 20 4c 6f 6f  |           \ Loo|
00000400  70 20 74 6f 20 64 72 61  77 20 68 6f 72 69 7a 6f  |p to draw horizo|
00000410  6e 74 61 6c 6c 79 0d 02  08 05 20 0d 02 12 29 4c  |ntally.... ...)L|
00000420  44 41 20 23 30 20 20 20  20 20 20 20 20 20 20 20  |DA #0           |
00000430  20 20 20 20 20 5c 20 43  6c 65 61 72 20 79 5f 63  |     \ Clear y_c|
00000440  6f 6f 72 64 0d 02 1c 0f  53 54 41 20 79 5f 63 6f  |oord....STA y_co|
00000450  6f 72 64 0d 02 26 11 53  54 41 20 79 5f 63 6f 6f  |ord..&.STA y_coo|
00000460  72 64 2b 31 0d 02 30 05  20 0d 02 3a 33 2e 79 5f  |rd+1..0. ..:3.y_|
00000470  6c 6f 6f 70 20 20 20 20  20 20 20 20 20 20 20 20  |loop            |
00000480  20 20 20 5c 20 4c 6f 6f  70 20 74 6f 20 64 72 61  |   \ Loop to dra|
00000490  77 20 76 65 72 74 69 63  61 6c 6c 79 0d 02 44 05  |w vertically..D.|
000004a0  20 0d 02 4e 12 4a 53 52  20 6d 61 6e 64 65 6c 62  | ..N.JSR mandelb|
000004b0  72 6f 74 0d 02 58 05 20  0d 02 62 3a 4c 44 41 20  |rot..X. ..b:LDA |
000004c0  23 32 35 20 20 20 20 20  20 20 20 20 20 20 20 20  |#25             |
000004d0  20 20 5c 20 f0 20 36 39  20 65 71 75 69 76 61 6c  |  \ . 69 equival|
000004e0  65 6e 74 20 2d 20 70 6c  6f 74 20 61 20 70 6f 69  |ent - plot a poi|
000004f0  6e 74 0d 02 6c 0e 4a 53  52 20 6f 73 77 72 63 68  |nt..l.JSR oswrch|
00000500  0d 02 76 0b 4c 44 41 20  23 36 39 0d 02 80 0e 4a  |..v.LDA #69....J|
00000510  53 52 20 6f 73 77 72 63  68 0d 02 8a 0f 4c 44 41  |SR oswrch....LDA|
00000520  20 78 5f 63 6f 6f 72 64  0d 02 94 0e 4a 53 52 20  | x_coord....JSR |
00000530  6f 73 77 72 63 68 0d 02  9e 11 4c 44 41 20 78 5f  |oswrch....LDA x_|
00000540  63 6f 6f 72 64 2b 31 0d  02 a8 0e 4a 53 52 20 6f  |coord+1....JSR o|
00000550  73 77 72 63 68 0d 02 b2  0f 4c 44 41 20 79 5f 63  |swrch....LDA y_c|
00000560  6f 6f 72 64 0d 02 bc 0e  4a 53 52 20 6f 73 77 72  |oord....JSR oswr|
00000570  63 68 0d 02 c6 11 4c 44  41 20 79 5f 63 6f 6f 72  |ch....LDA y_coor|
00000580  64 2b 31 0d 02 d0 0e 4a  53 52 20 6f 73 77 72 63  |d+1....JSR oswrc|
00000590  68 0d 02 da 05 20 0d 02  e4 0f 4c 44 41 20 79 5f  |h.... ....LDA y_|
000005a0  63 6f 6f 72 64 0d 02 ee  07 43 4c 43 0d 02 f8 0f  |coord....CLC....|
000005b0  41 44 43 20 23 79 5f 73  74 65 70 0d 03 02 39 53  |ADC #y_step...9S|
000005c0  54 41 20 79 5f 63 6f 6f  72 64 20 20 20 20 20 20  |TA y_coord      |
000005d0  20 20 20 20 20 5c 20 41  64 64 20 79 5f 73 74 65  |     \ Add y_ste|
000005e0  70 20 74 6f 20 63 75 72  72 65 6e 74 20 79 5f 63  |p to current y_c|
000005f0  6f 6f 72 64 0d 03 0c 11  4c 44 41 20 79 5f 63 6f  |oord....LDA y_co|
00000600  6f 72 64 2b 31 0d 03 16  0a 41 44 43 20 23 30 0d  |ord+1....ADC #0.|
00000610  03 20 11 53 54 41 20 79  5f 63 6f 6f 72 64 2b 31  |. .STA y_coord+1|
00000620  0d 03 2a 41 43 4d 50 20  23 34 20 20 20 20 20 20  |..*ACMP #4      |
00000630  20 20 20 20 20 20 20 20  20 20 5c 20 43 68 65 63  |          \ Chec|
00000640  6b 20 69 66 20 77 65 20  68 61 76 65 20 65 78 63  |k if we have exc|
00000650  65 65 64 65 64 20 31 30  32 33 20 28 26 33 46 46  |eeded 1023 (&3FF|
00000660  29 0d 03 34 0e 42 4e 45  20 79 5f 6c 6f 6f 70 0d  |)..4.BNE y_loop.|
00000670  03 3e 05 20 0d 03 48 0f  4c 44 41 20 78 5f 63 6f  |.>. ..H.LDA x_co|
00000680  6f 72 64 0d 03 52 07 43  4c 43 0d 03 5c 0f 41 44  |ord..R.CLC..\.AD|
00000690  43 20 23 78 5f 73 74 65  70 0d 03 66 39 53 54 41  |C #x_step..f9STA|
000006a0  20 78 5f 63 6f 6f 72 64  20 20 20 20 20 20 20 20  | x_coord        |
000006b0  20 20 20 5c 20 41 64 64  20 78 5f 73 74 65 70 20  |   \ Add x_step |
000006c0  74 6f 20 63 75 72 72 65  6e 74 20 78 5f 63 6f 6f  |to current x_coo|
000006d0  72 64 0d 03 70 11 4c 44  41 20 78 5f 63 6f 6f 72  |rd..p.LDA x_coor|
000006e0  64 2b 31 0d 03 7a 0a 41  44 43 20 23 30 0d 03 84  |d+1..z.ADC #0...|
000006f0  11 53 54 41 20 78 5f 63  6f 6f 72 64 2b 31 0d 03  |.STA x_coord+1..|
00000700  8e 41 43 4d 50 20 23 34  20 20 20 20 20 20 20 20  |.ACMP #4        |
00000710  20 20 20 20 20 20 20 20  5c 20 43 68 65 63 6b 20  |        \ Check |
00000720  69 66 20 77 65 20 68 61  76 65 20 65 78 63 65 65  |if we have excee|
00000730  64 65 64 20 31 30 32 33  20 28 26 33 46 46 29 0d  |ded 1023 (&3FF).|
00000740  03 98 0e 42 4e 45 20 78  5f 6c 6f 6f 70 0d 03 a2  |...BNE x_loop...|
00000750  05 20 0d 03 ac 07 52 54  53 0d 03 b6 05 20 0d 03  |. ....RTS.... ..|
00000760  c0 0f 2e 6d 61 6e 64 65  6c 62 72 6f 74 0d 03 ca  |...mandelbrot...|
00000770  05 20 0d 03 d4 3e 5c 20  20 46 6f 72 20 65 61 63  |. ...>\  For eac|
00000780  68 20 73 63 72 65 65 6e  20 70 6f 69 6e 74 20 77  |h screen point w|
00000790  65 20 63 6f 6d 70 75 74  65 20 68 6f 77 20 6d 61  |e compute how ma|
000007a0  6e 79 20 69 74 65 72 61  74 69 6f 6e 73 20 6f 66  |ny iterations of|
000007b0  0d 03 de 3e 5c 20 20 7a  3d 7a 5e 32 2b 63 20 28  |...>\  z=z^2+c (|
000007c0  77 68 65 72 65 20 7a 20  61 6e 64 20 63 20 61 72  |where z and c ar|
000007d0  65 20 63 6f 6d 70 6c 65  78 29 20 69 74 20 74 61  |e complex) it ta|
000007e0  6b 65 73 20 66 6f 72 20  7c 7a 7c 20 74 6f 0d 03  |kes for |z| to..|
000007f0  e8 36 5c 20 20 65 78 63  65 65 64 20 32 20 77 69  |.6\  exceed 2 wi|
00000800  74 68 20 61 20 6c 69 6d  69 74 20 6f 66 20 33 32  |th a limit of 32|
00000810  20 69 74 65 72 61 74 69  6f 6e 73 20 69 6e 20 74  | iterations in t|
00000820  6f 74 61 6c 0d 03 f2 36  5c 20 20 54 68 65 20 4d  |otal...6\  The M|
00000830  61 6e 64 65 6c 62 72 6f  74 20 73 65 74 20 65 78  |andelbrot set ex|
00000840  69 73 74 73 20 77 69 74  68 69 6e 20 74 68 65 73  |ists within thes|
00000850  65 20 62 6f 75 6e 64 73  20 2d 0d 03 fc 34 5c 20  |e bounds -...4\ |
00000860  20 52 65 61 6c 20 3d 20  2d 32 2e 32 35 20 74 6f  | Real = -2.25 to|
00000870  20 30 2e 37 35 20 20 49  6d 61 67 69 6e 61 72 79  | 0.75  Imaginary|
00000880  20 3d 20 2d 31 2e 35 20  74 6f 20 31 2e 35 0d 04  | = -1.5 to 1.5..|
00000890  06 43 5c 20 20 54 68 75  73 20 2e 2e 2e 2e 20 68  |.C\  Thus .... h|
000008a0  5f 69 6e 63 3d 76 5f 69  6e 63 3d 33 2f 31 30 32  |_inc=v_inc=3/102|
000008b0  34 20 77 68 69 63 68 20  69 73 20 26 43 30 20 69  |4 which is &C0 i|
000008c0  6e 20 6f 75 72 20 66 69  78 65 64 20 70 6f 69 6e  |n our fixed poin|
000008d0  74 0d 04 10 05 20 0d 04  1a 3f 5c 20 20 46 69 72  |t.... ...?\  Fir|
000008e0  73 74 20 63 6f 6d 70 75  74 65 20 76 61 6c 75 65  |st compute value|
000008f0  20 6f 66 20 63 5f 72 65  61 6c 20 28 3d 72 65 61  | of c_real (=rea|
00000900  6c 28 6c 6f 77 29 2b 78  5f 63 6f 6f 72 64 2a 68  |l(low)+x_coord*h|
00000910  5f 69 6e 63 29 0d 04 24  05 20 0d 04 2e 0a 4c 44  |_inc)..$. ....LD|
00000920  58 20 23 34 0d 04 38 05  20 0d 04 42 38 2e 74 72  |X #4..8. ..B8.tr|
00000930  61 6e 73 66 65 72 5f 68  69 6e 63 5f 6c 6f 6f 70  |ansfer_hinc_loop|
00000940  20 20 20 5c 20 4d 6f 76  65 20 68 5f 69 6e 63 20  |   \ Move h_inc |
00000950  69 6e 74 6f 20 6d 75 6c  74 69 70 6c 69 63 61 6e  |into multiplican|
00000960  64 0d 04 4c 05 20 0d 04  56 43 4c 44 41 20 68 5f  |d..L. ..VCLDA h_|
00000970  69 6e 63 2d 31 2c 20 58  20 20 20 20 20 20 20 20  |inc-1, X        |
00000980  5c 20 4f 66 66 73 65 74  20 66 72 6f 6d 20 61 64  |\ Offset from ad|
00000990  64 72 65 73 73 2d 31 20  73 6f 20 77 65 20 63 61  |dress-1 so we ca|
000009a0  6e 20 75 73 65 20 42 4e  45 0d 04 60 19 53 54 41  |n use BNE..`.STA|
000009b0  20 6d 75 6c 74 69 70 6c  69 63 61 6e 64 2d 31 2c  | multiplicand-1,|
000009c0  20 58 0d 04 6a 07 44 45  58 0d 04 74 1a 42 4e 45  | X..j.DEX..t.BNE|
000009d0  20 74 72 61 6e 73 66 65  72 5f 68 69 6e 63 5f 6c  | transfer_hinc_l|
000009e0  6f 6f 70 0d 04 7e 05 20  0d 04 88 38 4c 44 41 20  |oop..~. ...8LDA |
000009f0  78 5f 63 6f 6f 72 64 20  20 20 20 20 20 20 20 20  |x_coord         |
00000a00  20 20 5c 20 4d 6f 76 65  20 78 5f 63 6f 6f 72 64  |  \ Move x_coord|
00000a10  20 69 6e 74 6f 20 6d 75  6c 74 69 70 6c 69 65 72  | into multiplier|
00000a20  0d 04 92 14 53 54 41 20  6d 75 6c 74 69 70 6c 69  |....STA multipli|
00000a30  65 72 2b 32 0d 04 9c 11  4c 44 41 20 78 5f 63 6f  |er+2....LDA x_co|
00000a40  6f 72 64 2b 31 0d 04 a6  14 53 54 41 20 6d 75 6c  |ord+1....STA mul|
00000a50  74 69 70 6c 69 65 72 2b  33 0d 04 b0 18 4a 53 52  |tiplier+3....JSR|
00000a60  20 66 69 78 65 64 5f 70  6f 69 6e 74 5f 6d 75 6c  | fixed_point_mul|
00000a70  74 0d 04 ba 05 20 0d 04  c4 0a 4c 44 58 20 23 34  |t.... ....LDX #4|
00000a80  0d 04 ce 05 20 0d 04 d8  18 2e 74 72 61 6e 73 66  |.... .....transf|
00000a90  65 72 5f 63 72 65 61 6c  5f 6c 6f 6f 70 0d 04 e2  |er_creal_loop...|
00000aa0  05 20 0d 04 ec 14 4c 44  41 20 66 78 70 5f 72 65  |. ....LDA fxp_re|
00000ab0  73 2d 31 2c 20 58 0d 04  f6 13 53 54 41 20 63 5f  |s-1, X....STA c_|
00000ac0  72 65 61 6c 2d 31 2c 20  58 0d 05 00 07 44 45 58  |real-1, X....DEX|
00000ad0  0d 05 0a 1b 42 4e 45 20  74 72 61 6e 73 66 65 72  |....BNE transfer|
00000ae0  5f 63 72 65 61 6c 5f 6c  6f 6f 70 0d 05 14 05 20  |_creal_loop.... |
00000af0  0d 05 1e 41 4c 44 41 20  23 26 43 30 20 20 20 20  |...ALDA #&C0    |
00000b00  20 20 20 20 20 20 20 20  20 20 5c 20 41 64 64 20  |          \ Add |
00000b10  2d 32 2e 32 35 2c 20 3d  20 26 46 46 46 44 43 30  |-2.25, = &FFFDC0|
00000b20  30 30 20 69 6e 20 66 69  78 65 64 20 70 6f 69 6e  |00 in fixed poin|
00000b30  74 0d 05 28 07 43 4c 43  0d 05 32 10 41 44 43 20  |t..(.CLC..2.ADC |
00000b40  63 5f 72 65 61 6c 2b 31  0d 05 3c 10 53 54 41 20  |c_real+1..<.STA |
00000b50  63 5f 72 65 61 6c 2b 31  0d 05 46 0c 4c 44 41 20  |c_real+1..F.LDA |
00000b60  23 26 46 44 0d 05 50 10  41 44 43 20 63 5f 72 65  |#&FD..P.ADC c_re|
00000b70  61 6c 2b 32 0d 05 5a 10  53 54 41 20 63 5f 72 65  |al+2..Z.STA c_re|
00000b80  61 6c 2b 32 0d 05 64 0c  4c 44 41 20 23 26 46 46  |al+2..d.LDA #&FF|
00000b90  0d 05 6e 10 41 44 43 20  63 5f 72 65 61 6c 2b 33  |..n.ADC c_real+3|
00000ba0  0d 05 78 10 53 54 41 20  63 5f 72 65 61 6c 2b 33  |..x.STA c_real+3|
00000bb0  0d 05 82 05 20 0d 05 8c  3e 5c 20 20 54 68 65 6e  |.... ...>\  Then|
00000bc0  20 63 6f 6d 70 75 74 65  20 76 61 6c 75 65 20 6f  | compute value o|
00000bd0  66 20 63 5f 69 6d 61 67  20 28 3d 69 6d 61 67 28  |f c_imag (=imag(|
00000be0  6c 6f 77 29 2b 79 5f 63  6f 6f 72 64 2a 76 5f 69  |low)+y_coord*v_i|
00000bf0  6e 63 29 0d 05 96 05 20  0d 05 a0 0a 4c 44 58 20  |nc).... ....LDX |
00000c00  23 34 0d 05 aa 05 20 0d  05 b4 17 2e 74 72 61 6e  |#4.... .....tran|
00000c10  73 66 65 72 5f 76 69 6e  63 5f 6c 6f 6f 70 0d 05  |sfer_vinc_loop..|
00000c20  be 05 20 0d 05 c8 12 4c  44 41 20 76 5f 69 6e 63  |.. ....LDA v_inc|
00000c30  2d 31 2c 20 58 0d 05 d2  19 53 54 41 20 6d 75 6c  |-1, X....STA mul|
00000c40  74 69 70 6c 69 63 61 6e  64 2d 31 2c 20 58 0d 05  |tiplicand-1, X..|
00000c50  dc 07 44 45 58 0d 05 e6  1a 42 4e 45 20 74 72 61  |..DEX....BNE tra|
00000c60  6e 73 66 65 72 5f 76 69  6e 63 5f 6c 6f 6f 70 0d  |nsfer_vinc_loop.|
00000c70  05 f0 05 20 0d 05 fa 0f  4c 44 41 20 79 5f 63 6f  |... ....LDA y_co|
00000c80  6f 72 64 0d 06 04 14 53  54 41 20 6d 75 6c 74 69  |ord....STA multi|
00000c90  70 6c 69 65 72 2b 32 0d  06 0e 11 4c 44 41 20 79  |plier+2....LDA y|
00000ca0  5f 63 6f 6f 72 64 2b 31  0d 06 18 14 53 54 41 20  |_coord+1....STA |
00000cb0  6d 75 6c 74 69 70 6c 69  65 72 2b 33 0d 06 22 18  |multiplier+3..".|
00000cc0  4a 53 52 20 66 69 78 65  64 5f 70 6f 69 6e 74 5f  |JSR fixed_point_|
00000cd0  6d 75 6c 74 0d 06 2c 05  20 0d 06 36 0a 4c 44 58  |mult..,. ..6.LDX|
00000ce0  20 23 34 0d 06 40 05 20  0d 06 4a 18 2e 74 72 61  | #4..@. ..J..tra|
00000cf0  6e 73 66 65 72 5f 63 69  6d 61 67 5f 6c 6f 6f 70  |nsfer_cimag_loop|
00000d00  0d 06 54 05 20 0d 06 5e  14 4c 44 41 20 66 78 70  |..T. ..^.LDA fxp|
00000d10  5f 72 65 73 2d 31 2c 20  58 0d 06 68 13 53 54 41  |_res-1, X..h.STA|
00000d20  20 63 5f 69 6d 61 67 2d  31 2c 20 58 0d 06 72 07  | c_imag-1, X..r.|
00000d30  44 45 58 0d 06 7c 1b 42  4e 45 20 74 72 61 6e 73  |DEX..|.BNE trans|
00000d40  66 65 72 5f 63 69 6d 61  67 5f 6c 6f 6f 70 0d 06  |fer_cimag_loop..|
00000d50  86 05 20 0d 06 90 3e 4c  44 41 20 23 26 38 30 20  |.. ...>LDA #&80 |
00000d60  20 20 20 20 20 20 20 20  20 20 20 20 20 5c 20 41  |             \ A|
00000d70  64 64 20 2d 31 2e 35 20  3d 20 26 46 46 46 45 38  |dd -1.5 = &FFFE8|
00000d80  30 30 20 69 6e 20 66 69  78 65 64 20 70 6f 69 6e  |00 in fixed poin|
00000d90  74 0d 06 9a 07 43 4c 43  0d 06 a4 10 41 44 43 20  |t....CLC....ADC |
00000da0  63 5f 69 6d 61 67 2b 31  0d 06 ae 10 53 54 41 20  |c_imag+1....STA |
00000db0  63 5f 69 6d 61 67 2b 31  0d 06 b8 0c 4c 44 41 20  |c_imag+1....LDA |
00000dc0  23 26 46 45 0d 06 c2 10  41 44 43 20 63 5f 69 6d  |#&FE....ADC c_im|
00000dd0  61 67 2b 32 0d 06 cc 10  53 54 41 20 63 5f 69 6d  |ag+2....STA c_im|
00000de0  61 67 2b 32 0d 06 d6 0c  4c 44 41 20 23 26 46 46  |ag+2....LDA #&FF|
00000df0  0d 06 e0 10 41 44 43 20  63 5f 69 6d 61 67 2b 33  |....ADC c_imag+3|
00000e00  0d 06 ea 10 53 54 41 20  63 5f 69 6d 61 67 2b 33  |....STA c_imag+3|
00000e10  0d 06 f4 05 20 0d 06 fe  39 4c 44 41 20 23 69 74  |.... ...9LDA #it|
00000e20  65 72 61 74 69 6f 6e 73  20 20 20 20 20 20 20 5c  |erations       \|
00000e30  20 49 6e 69 74 69 61 6c  69 73 65 20 69 74 65 72  | Initialise iter|
00000e40  61 74 69 6f 6e 73 20 63  6f 75 6e 74 65 72 0d 07  |ations counter..|
00000e50  08 0d 53 54 41 20 63 6f  75 6e 74 0d 07 12 0a 4c  |..STA count....L|
00000e60  44 41 20 23 30 0d 07 1c  0a 4c 44 58 20 23 34 0d  |DA #0....LDX #4.|
00000e70  07 26 05 20 0d 07 30 30  2e 72 65 73 65 74 5f 78  |.&. ..00.reset_x|
00000e80  79 5f 6c 6f 6f 70 20 20  20 20 20 20 20 20 5c 20  |y_loop        \ |
00000e90  43 6c 65 61 72 20 78 20  79 20 77 6f 72 6b 20 73  |Clear x y work s|
00000ea0  70 61 63 65 0d 07 3a 05  20 0d 07 44 0e 53 54 41  |pace..:. ..D.STA|
00000eb0  20 78 2d 31 2c 20 58 0d  07 4e 0e 53 54 41 20 79  | x-1, X..N.STA y|
00000ec0  2d 31 2c 20 58 0d 07 58  07 44 45 58 0d 07 62 15  |-1, X..X.DEX..b.|
00000ed0  42 4e 45 20 72 65 73 65  74 5f 78 79 5f 6c 6f 6f  |BNE reset_xy_loo|
00000ee0  70 0d 07 6c 05 20 0d 07  76 39 2e 6d 61 6e 64 65  |p..l. ..v9.mande|
00000ef0  6c 62 72 6f 74 5f 6c 6f  6f 70 20 20 20 20 20 20  |lbrot_loop      |
00000f00  5c 20 4d 61 69 6e 20 6c  6f 6f 70 20 70 65 72 66  |\ Main loop perf|
00000f10  6f 72 6d 73 20 69 74 65  72 61 74 69 6f 6e 73 0d  |orms iterations.|
00000f20  07 80 05 20 0d 07 8a 41  5c 20 20 47 65 74 20 73  |... ...A\  Get s|
00000f30  71 75 61 72 65 73 20 6f  66 20 78 20 61 6e 64 20  |quares of x and |
00000f40  79 20 62 79 20 70 75 74  74 69 6e 67 20 78 20 69  |y by putting x i|
00000f50  6e 74 6f 20 62 6f 74 68  20 6d 75 6c 74 69 70 6c  |nto both multipl|
00000f60  69 63 61 6e 64 0d 07 94  3a 5c 20 20 61 6e 64 20  |icand...:\  and |
00000f70  6d 75 6c 74 69 70 6c 69  65 72 20 61 6e 64 20 63  |multiplier and c|
00000f80  61 6c 6c 69 6e 67 20 74  68 65 20 66 69 78 65 64  |alling the fixed|
00000f90  20 70 6f 69 6e 74 20 6d  75 6c 74 69 70 6c 79 0d  | point multiply.|
00000fa0  07 9e 43 5c 20 20 72 6f  75 74 69 6e 65 2e 20 20  |..C\  routine.  |
00000fb0  53 74 6f 72 65 20 69 6e  20 73 70 61 63 65 20 6c  |Store in space l|
00000fc0  61 62 65 6c 6c 65 64 20  78 5f 73 71 75 61 72 65  |abelled x_square|
00000fd0  64 20 61 6e 64 20 72 65  70 65 61 74 20 66 6f 72  |d and repeat for|
00000fe0  20 79 0d 07 a8 05 20 0d  07 b2 0a 4c 44 58 20 23  | y.... ....LDX #|
00000ff0  34 0d 07 bc 05 20 0d 07  c6 1a 2e 78 5f 73 71 75  |4.... .....x_squ|
00001000  61 72 65 5f 70 72 65 70  61 72 65 5f 6c 6f 6f 70  |are_prepare_loop|
00001010  0d 07 d0 05 20 0d 07 da  0e 4c 44 41 20 78 2d 31  |.... ....LDA x-1|
00001020  2c 20 58 0d 07 e4 19 53  54 41 20 6d 75 6c 74 69  |, X....STA multi|
00001030  70 6c 69 63 61 6e 64 2d  31 2c 20 58 0d 07 ee 17  |plicand-1, X....|
00001040  53 54 41 20 6d 75 6c 74  69 70 6c 69 65 72 2d 31  |STA multiplier-1|
00001050  2c 20 58 0d 07 f8 07 44  45 58 0d 08 02 1d 42 4e  |, X....DEX....BN|
00001060  45 20 78 5f 73 71 75 61  72 65 5f 70 72 65 70 61  |E x_square_prepa|
00001070  72 65 5f 6c 6f 6f 70 0d  08 0c 05 20 0d 08 16 18  |re_loop.... ....|
00001080  4a 53 52 20 66 69 78 65  64 5f 70 6f 69 6e 74 5f  |JSR fixed_point_|
00001090  6d 75 6c 74 0d 08 20 05  20 0d 08 2a 0a 4c 44 58  |mult.. . ..*.LDX|
000010a0  20 23 34 0d 08 34 05 20  0d 08 3e 1a 2e 78 5f 73  | #4..4. ..>..x_s|
000010b0  71 75 61 72 65 5f 72 65  63 6f 76 65 72 5f 6c 6f  |quare_recover_lo|
000010c0  6f 70 0d 08 48 05 20 0d  08 52 14 4c 44 41 20 66  |op..H. ..R.LDA f|
000010d0  78 70 5f 72 65 73 2d 31  2c 20 58 0d 08 5c 16 53  |xp_res-1, X..\.S|
000010e0  54 41 20 78 5f 73 71 75  61 72 65 64 2d 31 2c 20  |TA x_squared-1, |
000010f0  58 0d 08 66 07 44 45 58  0d 08 70 1d 42 4e 45 20  |X..f.DEX..p.BNE |
00001100  78 5f 73 71 75 61 72 65  5f 72 65 63 6f 76 65 72  |x_square_recover|
00001110  5f 6c 6f 6f 70 0d 08 7a  0a 4c 44 58 20 23 34 0d  |_loop..z.LDX #4.|
00001120  08 84 05 20 0d 08 8e 1a  2e 79 5f 73 71 75 61 72  |... .....y_squar|
00001130  65 5f 70 72 65 70 61 72  65 5f 6c 6f 6f 70 0d 08  |e_prepare_loop..|
00001140  98 05 20 0d 08 a2 0e 4c  44 41 20 79 2d 31 2c 20  |.. ....LDA y-1, |
00001150  58 0d 08 ac 19 53 54 41  20 6d 75 6c 74 69 70 6c  |X....STA multipl|
00001160  69 63 61 6e 64 2d 31 2c  20 58 0d 08 b6 17 53 54  |icand-1, X....ST|
00001170  41 20 6d 75 6c 74 69 70  6c 69 65 72 2d 31 2c 20  |A multiplier-1, |
00001180  58 0d 08 c0 07 44 45 58  0d 08 ca 1d 42 4e 45 20  |X....DEX....BNE |
00001190  79 5f 73 71 75 61 72 65  5f 70 72 65 70 61 72 65  |y_square_prepare|
000011a0  5f 6c 6f 6f 70 0d 08 d4  05 20 0d 08 de 18 4a 53  |_loop.... ....JS|
000011b0  52 20 66 69 78 65 64 5f  70 6f 69 6e 74 5f 6d 75  |R fixed_point_mu|
000011c0  6c 74 0d 08 e8 05 20 0d  08 f2 0a 4c 44 58 20 23  |lt.... ....LDX #|
000011d0  34 0d 08 fc 05 20 0d 09  06 1a 2e 79 5f 73 71 75  |4.... .....y_squ|
000011e0  61 72 65 5f 72 65 63 6f  76 65 72 5f 6c 6f 6f 70  |are_recover_loop|
000011f0  0d 09 10 05 20 0d 09 1a  14 4c 44 41 20 66 78 70  |.... ....LDA fxp|
00001200  5f 72 65 73 2d 31 2c 20  58 0d 09 24 16 53 54 41  |_res-1, X..$.STA|
00001210  20 79 5f 73 71 75 61 72  65 64 2d 31 2c 20 58 0d  | y_squared-1, X.|
00001220  09 2e 07 44 45 58 0d 09  38 1d 42 4e 45 20 79 5f  |...DEX..8.BNE y_|
00001230  73 71 75 61 72 65 5f 72  65 63 6f 76 65 72 5f 6c  |square_recover_l|
00001240  6f 6f 70 0d 09 42 05 20  0d 09 4c 31 5c 20 20 4e  |oop..B. ..L1\  N|
00001250  6f 77 20 63 61 6c 63 75  6c 61 74 65 20 73 69 7a  |ow calculate siz|
00001260  65 20 28 3d 20 78 5f 73  71 75 61 72 65 64 2b 79  |e (= x_squared+y|
00001270  5f 73 71 75 61 72 65 64  29 0d 09 56 05 20 0d 09  |_squared)..V. ..|
00001280  60 07 43 4c 43 0d 09 6a  11 4c 44 41 20 78 5f 73  |`.CLC..j.LDA x_s|
00001290  71 75 61 72 65 64 0d 09  74 11 41 44 43 20 79 5f  |quared..t.ADC y_|
000012a0  73 71 75 61 72 65 64 0d  09 7e 0c 53 54 41 20 73  |squared..~.STA s|
000012b0  69 7a 65 0d 09 88 13 4c  44 41 20 78 5f 73 71 75  |ize....LDA x_squ|
000012c0  61 72 65 64 2b 31 0d 09  92 13 41 44 43 20 79 5f  |ared+1....ADC y_|
000012d0  73 71 75 61 72 65 64 2b  31 0d 09 9c 0e 53 54 41  |squared+1....STA|
000012e0  20 73 69 7a 65 2b 31 0d  09 a6 13 4c 44 41 20 78  | size+1....LDA x|
000012f0  5f 73 71 75 61 72 65 64  2b 32 0d 09 b0 13 41 44  |_squared+2....AD|
00001300  43 20 79 5f 73 71 75 61  72 65 64 2b 32 0d 09 ba  |C y_squared+2...|
00001310  0e 53 54 41 20 73 69 7a  65 2b 32 0d 09 c4 13 4c  |.STA size+2....L|
00001320  44 41 20 78 5f 73 71 75  61 72 65 64 2b 33 0d 09  |DA x_squared+3..|
00001330  ce 13 41 44 43 20 79 5f  73 71 75 61 72 65 64 2b  |..ADC y_squared+|
00001340  33 0d 09 d8 0e 53 54 41  20 73 69 7a 65 2b 33 0d  |3....STA size+3.|
00001350  09 e2 05 20 0d 09 ec 1c  5c 20 20 4e 65 77 20 79  |... ....\  New y|
00001360  20 69 73 20 32 2a 78 2a  79 2b 63 5f 69 6d 61 67  | is 2*x*y+c_imag|
00001370  0d 09 f6 05 20 0d 0a 00  0a 4c 44 58 20 23 34 0d  |.... ....LDX #4.|
00001380  0a 0a 05 20 0d 0a 14 19  2e 74 72 61 6e 73 66 65  |... .....transfe|
00001390  72 5f 78 79 5f 66 6f 72  5f 6d 75 6c 74 0d 0a 1e  |r_xy_for_mult...|
000013a0  05 20 0d 0a 28 0e 4c 44  41 20 78 2d 31 2c 20 58  |. ..(.LDA x-1, X|
000013b0  0d 0a 32 17 53 54 41 20  6d 75 6c 74 69 70 6c 69  |..2.STA multipli|
000013c0  65 72 2d 31 2c 20 58 0d  0a 3c 0e 4c 44 41 20 79  |er-1, X..<.LDA y|
000013d0  2d 31 2c 20 58 0d 0a 46  19 53 54 41 20 6d 75 6c  |-1, X..F.STA mul|
000013e0  74 69 70 6c 69 63 61 6e  64 2d 31 2c 20 58 0d 0a  |tiplicand-1, X..|
000013f0  50 07 44 45 58 0d 0a 5a  1c 42 4e 45 20 74 72 61  |P.DEX..Z.BNE tra|
00001400  6e 73 66 65 72 5f 78 79  5f 66 6f 72 5f 6d 75 6c  |nsfer_xy_for_mul|
00001410  74 0d 0a 64 05 20 0d 0a  6e 18 4a 53 52 20 66 69  |t..d. ..n.JSR fi|
00001420  78 65 64 5f 70 6f 69 6e  74 5f 6d 75 6c 74 0d 0a  |xed_point_mult..|
00001430  78 05 20 0d 0a 82 0a 4c  44 58 20 23 34 0d 0a 8c  |x. ....LDX #4...|
00001440  05 20 0d 0a 96 1b 2e 74  72 61 6e 73 66 65 72 5f  |. .....transfer_|
00001450  78 79 5f 61 66 74 65 72  5f 6d 75 6c 74 0d 0a a0  |xy_after_mult...|
00001460  05 20 0d 0a aa 14 4c 44  41 20 66 78 70 5f 72 65  |. ....LDA fxp_re|
00001470  73 2d 31 2c 20 58 0d 0a  b4 0e 53 54 41 20 79 2d  |s-1, X....STA y-|
00001480  31 2c 20 58 0d 0a be 07  44 45 58 0d 0a c8 1e 42  |1, X....DEX....B|
00001490  4e 45 20 74 72 61 6e 73  66 65 72 5f 78 79 5f 61  |NE transfer_xy_a|
000014a0  66 74 65 72 5f 6d 75 6c  74 0d 0a d2 05 20 0d 0a  |fter_mult.... ..|
000014b0  dc 28 5c 20 20 4d 75 6c  74 69 70 6c 79 20 62 79  |.(\  Multiply by|
000014c0  20 32 20 28 69 2e 65 2e  20 61 20 73 68 69 66 74  | 2 (i.e. a shift|
000014d0  20 6c 65 66 74 29 0d 0a  e6 05 20 0d 0a f0 09 41  | left).... ....A|
000014e0  53 4c 20 79 0d 0a fa 0b  52 4f 4c 20 79 2b 31 0d  |SL y....ROL y+1.|
000014f0  0b 04 0b 52 4f 4c 20 79  2b 32 0d 0b 0e 0b 52 4f  |...ROL y+2....RO|
00001500  4c 20 79 2b 33 0d 0b 18  05 20 0d 0b 22 3b 5c 20  |L y+3.... ..";\ |
00001510  20 54 72 61 70 20 66 6f  72 20 73 69 7a 65 20 62  | Trap for size b|
00001520  79 20 63 68 65 63 6b 69  6e 67 20 62 79 74 65 20  |y checking byte |
00001530  32 20 6f 66 20 66 69 78  65 64 20 70 6f 69 6e 74  |2 of fixed point|
00001540  20 77 6f 72 64 0d 0b 2c  32 5c 20 20 44 6f 6e 65  | word..,2\  Done|
00001550  20 69 6e 20 6f 64 64 20  70 6c 61 63 65 20 74 6f  | in odd place to|
00001560  20 6f 70 74 69 6d 69 73  65 20 62 72 61 6e 63 68  | optimise branch|
00001570  20 6c 65 6e 67 74 68 0d  0b 36 05 20 0d 0b 40 0e  | length..6. ..@.|
00001580  4c 44 41 20 73 69 7a 65  2b 32 0d 0b 4a 13 43 4d  |LDA size+2..J.CM|
00001590  50 20 23 73 69 7a 65 5f  6c 69 6d 69 74 0d 0b 54  |P #size_limit..T|
000015a0  10 42 43 53 20 73 69 7a  65 5f 6f 75 74 0d 0b 5e  |.BCS size_out..^|
000015b0  05 20 0d 0b 68 2e 5c 20  20 52 65 74 75 72 6e 69  |. ..h.\  Returni|
000015c0  6e 67 20 74 6f 20 79 20  63 61 6c 63 75 6c 61 74  |ng to y calculat|
000015d0  69 6f 6e 20 2d 20 41 64  64 20 63 5f 69 6d 61 67  |ion - Add c_imag|
000015e0  0d 0b 72 05 20 0d 0b 7c  07 43 4c 43 0d 0b 86 09  |..r. ..|.CLC....|
000015f0  4c 44 41 20 79 0d 0b 90  0e 41 44 43 20 63 5f 69  |LDA y....ADC c_i|
00001600  6d 61 67 0d 0b 9a 09 53  54 41 20 79 0d 0b a4 0b  |mag....STA y....|
00001610  4c 44 41 20 79 2b 31 0d  0b ae 10 41 44 43 20 63  |LDA y+1....ADC c|
00001620  5f 69 6d 61 67 2b 31 0d  0b b8 0b 53 54 41 20 79  |_imag+1....STA y|
00001630  2b 31 0d 0b c2 0b 4c 44  41 20 79 2b 32 0d 0b cc  |+1....LDA y+2...|
00001640  10 41 44 43 20 63 5f 69  6d 61 67 2b 32 0d 0b d6  |.ADC c_imag+2...|
00001650  0b 53 54 41 20 79 2b 32  0d 0b e0 0b 4c 44 41 20  |.STA y+2....LDA |
00001660  79 2b 33 0d 0b ea 10 41  44 43 20 63 5f 69 6d 61  |y+3....ADC c_ima|
00001670  67 2b 33 0d 0b f4 0b 53  54 41 20 79 2b 33 0d 0b  |g+3....STA y+3..|
00001680  fe 05 20 0d 0c 08 33 5c  20 20 4e 65 77 20 76 61  |.. ...3\  New va|
00001690  6c 75 65 20 6f 66 20 78  20 69 73 20 78 5f 73 71  |lue of x is x_sq|
000016a0  75 61 72 65 64 2d 79 5f  73 71 75 61 72 65 64 2b  |uared-y_squared+|
000016b0  63 5f 72 65 61 6c 0d 0c  12 05 20 0d 0c 1c 07 53  |c_real.... ....S|
000016c0  45 43 0d 0c 26 11 4c 44  41 20 78 5f 73 71 75 61  |EC..&.LDA x_squa|
000016d0  72 65 64 0d 0c 30 11 53  42 43 20 79 5f 73 71 75  |red..0.SBC y_squ|
000016e0  61 72 65 64 0d 0c 3a 09  53 54 41 20 78 0d 0c 44  |ared..:.STA x..D|
000016f0  13 4c 44 41 20 78 5f 73  71 75 61 72 65 64 2b 31  |.LDA x_squared+1|
00001700  0d 0c 4e 13 53 42 43 20  79 5f 73 71 75 61 72 65  |..N.SBC y_square|
00001710  64 2b 31 0d 0c 58 0b 53  54 41 20 78 2b 31 0d 0c  |d+1..X.STA x+1..|
00001720  62 13 4c 44 41 20 78 5f  73 71 75 61 72 65 64 2b  |b.LDA x_squared+|
00001730  32 0d 0c 6c 13 53 42 43  20 79 5f 73 71 75 61 72  |2..l.SBC y_squar|
00001740  65 64 2b 32 0d 0c 76 0b  53 54 41 20 78 2b 32 0d  |ed+2..v.STA x+2.|
00001750  0c 80 13 4c 44 41 20 78  5f 73 71 75 61 72 65 64  |...LDA x_squared|
00001760  2b 33 0d 0c 8a 13 53 42  43 20 79 5f 73 71 75 61  |+3....SBC y_squa|
00001770  72 65 64 2b 33 0d 0c 94  0b 53 54 41 20 78 2b 33  |red+3....STA x+3|
00001780  0d 0c 9e 05 20 0d 0c a8  07 43 4c 43 0d 0c b2 09  |.... ....CLC....|
00001790  4c 44 41 20 78 0d 0c bc  0e 41 44 43 20 63 5f 72  |LDA x....ADC c_r|
000017a0  65 61 6c 0d 0c c6 09 53  54 41 20 78 0d 0c d0 0b  |eal....STA x....|
000017b0  4c 44 41 20 78 2b 31 0d  0c da 10 41 44 43 20 63  |LDA x+1....ADC c|
000017c0  5f 72 65 61 6c 2b 31 0d  0c e4 0b 53 54 41 20 78  |_real+1....STA x|
000017d0  2b 31 0d 0c ee 0b 4c 44  41 20 78 2b 32 0d 0c f8  |+1....LDA x+2...|
000017e0  10 41 44 43 20 63 5f 72  65 61 6c 2b 32 0d 0d 02  |.ADC c_real+2...|
000017f0  0b 53 54 41 20 78 2b 32  0d 0d 0c 0b 4c 44 41 20  |.STA x+2....LDA |
00001800  78 2b 33 0d 0d 16 10 41  44 43 20 63 5f 72 65 61  |x+3....ADC c_rea|
00001810  6c 2b 33 0d 0d 20 0b 53  54 41 20 78 2b 33 0d 0d  |l+3.. .STA x+3..|
00001820  2a 05 20 0d 0d 34 34 5c  20 20 54 72 61 70 20 66  |*. ..44\  Trap f|
00001830  6f 72 20 6d 61 78 69 6d  75 6d 20 6e 75 6d 62 65  |or maximum numbe|
00001840  72 20 6f 66 20 69 74 65  72 61 74 69 6f 6e 73 20  |r of iterations |
00001850  61 6c 6c 6f 77 65 64 0d  0d 3e 05 20 0d 0d 48 0d  |allowed..>. ..H.|
00001860  44 45 43 20 63 6f 75 6e  74 0d 0d 52 11 42 45 51  |DEC count..R.BEQ|
00001870  20 63 6f 75 6e 74 5f 6f  75 74 0d 0d 5c 05 20 0d  | count_out..\. .|
00001880  0d 66 17 4a 4d 50 20 6d  61 6e 64 65 6c 62 72 6f  |.f.JMP mandelbro|
00001890  74 5f 6c 6f 6f 70 0d 0d  70 05 20 0d 0d 7a 43 2e  |t_loop..p. ..zC.|
000018a0  73 69 7a 65 5f 6f 75 74  20 20 20 20 20 20 20 20  |size_out        |
000018b0  20 20 20 20 20 5c 20 49  66 20 73 69 7a 65 20 65  |     \ If size e|
000018c0  78 63 65 65 64 73 20 6c  69 6d 69 74 20 70 69 78  |xceeds limit pix|
000018d0  65 6c 20 69 73 20 63 6f  6c 6f 75 72 65 64 0d 0d  |el is coloured..|
000018e0  84 05 20 0d 0d 8e 0b 4c  44 41 20 23 31 38 0d 0d  |.. ....LDA #18..|
000018f0  98 0e 4a 53 52 20 6f 73  77 72 63 68 0d 0d a2 0a  |..JSR oswrch....|
00001900  4c 44 41 20 23 30 0d 0d  ac 0e 4a 53 52 20 6f 73  |LDA #0....JSR os|
00001910  77 72 63 68 0d 0d b6 0d  4c 44 41 20 63 6f 75 6e  |wrch....LDA coun|
00001920  74 0d 0d c0 32 80 20 23  37 20 20 20 20 20 20 20  |t...2. #7       |
00001930  20 20 20 20 20 20 20 20  20 5c 20 47 69 76 65 73  |         \ Gives|
00001940  20 76 61 6c 75 65 73 20  66 72 6f 6d 20 30 20 74  | values from 0 t|
00001950  6f 20 37 0d 0d ca 0e 4a  53 52 20 6f 73 77 72 63  |o 7....JSR oswrc|
00001960  68 0d 0d d4 07 52 54 53  0d 0d de 05 20 0d 0d e8  |h....RTS.... ...|
00001970  4c 2e 63 6f 75 6e 74 5f  6f 75 74 20 20 20 20 20  |L.count_out     |
00001980  20 20 20 20 20 20 20 5c  20 49 66 20 77 65 20 72  |       \ If we r|
00001990  65 61 63 68 20 69 74 65  72 61 74 69 6f 6e 73 20  |each iterations |
000019a0  6c 69 6d 69 74 20 74 68  65 6e 20 70 69 78 65 6c  |limit then pixel|
000019b0  20 69 73 20 62 6c 61 63  6b 0d 0d f2 05 20 0d 0d  | is black.... ..|
000019c0  fc 1d 4c 44 41 20 23 31  38 20 20 20 20 20 20 20  |..LDA #18       |
000019d0  20 20 20 20 20 20 20 20  5c 20 e6 0d 0e 06 0e 4a  |        \ .....J|
000019e0  53 52 20 6f 73 77 72 63  68 0d 0e 10 0a 4c 44 41  |SR oswrch....LDA|
000019f0  20 23 30 0d 0e 1a 0e 4a  53 52 20 6f 73 77 72 63  | #0....JSR oswrc|
00001a00  68 0d 0e 24 0e 4a 53 52  20 6f 73 77 72 63 68 0d  |h..$.JSR oswrch.|
00001a10  0e 2e 07 52 54 53 0d 0e  38 05 20 0d 0e 42 1d 2e  |...RTS..8. ..B..|
00001a20  78 5f 63 6f 6f 72 64 20  20 20 4f 50 54 20 20 20  |x_coord   OPT   |
00001a30  a4 45 51 55 57 28 30 29  0d 0e 4c 1d 2e 79 5f 63  |.EQUW(0)..L..y_c|
00001a40  6f 6f 72 64 20 20 20 4f  50 54 20 20 20 a4 45 51  |oord   OPT   .EQ|
00001a50  55 57 28 30 29 0d 0e 56  1d 2e 63 5f 72 65 61 6c  |UW(0)..V..c_real|
00001a60  20 20 20 20 4f 50 54 20  20 20 a4 45 51 55 44 28  |    OPT   .EQUD(|
00001a70  30 29 0d 0e 60 1d 2e 63  5f 69 6d 61 67 20 20 20  |0)..`..c_imag   |
00001a80  20 4f 50 54 20 20 20 a4  45 51 55 44 28 30 29 0d  | OPT   .EQUD(0).|
00001a90  0e 6a 1d 2e 63 6f 75 6e  74 20 20 20 20 20 4f 50  |.j..count     OP|
00001aa0  54 20 20 20 a4 45 51 55  42 28 30 29 0d 0e 74 1d  |T   .EQUB(0)..t.|
00001ab0  2e 73 69 7a 65 20 20 20  20 20 20 4f 50 54 20 20  |.size      OPT  |
00001ac0  20 a4 45 51 55 44 28 30  29 0d 0e 7e 1d 2e 78 20  | .EQUD(0)..~..x |
00001ad0  20 20 20 20 20 20 20 20  4f 50 54 20 20 20 a4 45  |        OPT   .E|
00001ae0  51 55 44 28 30 29 0d 0e  88 1d 2e 79 20 20 20 20  |QUD(0).....y    |
00001af0  20 20 20 20 20 4f 50 54  20 20 20 a4 45 51 55 44  |     OPT   .EQUD|
00001b00  28 30 29 0d 0e 92 1d 2e  78 5f 73 71 75 61 72 65  |(0).....x_square|
00001b10  64 20 4f 50 54 20 20 20  a4 45 51 55 44 28 30 29  |d OPT   .EQUD(0)|
00001b20  0d 0e 9c 1d 2e 79 5f 73  71 75 61 72 65 64 20 4f  |.....y_squared O|
00001b30  50 54 20 20 20 a4 45 51  55 44 28 30 29 0d 0e a6  |PT   .EQUD(0)...|
00001b40  1f 2e 68 5f 69 6e 63 20  20 20 20 20 4f 50 54 20  |..h_inc     OPT |
00001b50  20 20 a4 45 51 55 44 28  26 43 30 29 0d 0e b0 1f  |  .EQUD(&C0)....|
00001b60  2e 76 5f 69 6e 63 20 20  20 20 20 4f 50 54 20 20  |.v_inc     OPT  |
00001b70  20 a4 45 51 55 44 28 26  43 30 29 0d 0e ba 05 20  | .EQUD(&C0).... |
00001b80  0d 0e c4 15 2e 66 69 78  65 64 5f 70 6f 69 6e 74  |.....fixed_point|
00001b90  5f 6d 75 6c 74 0d 0e ce  05 20 0d 0e d8 39 5c 20  |_mult.... ...9\ |
00001ba0  20 41 73 73 75 6d 65 73  20 74 68 61 74 20 6e 75  | Assumes that nu|
00001bb0  6d 62 65 72 73 20 74 6f  20 62 65 20 6d 75 6c 74  |mbers to be mult|
00001bc0  69 70 6c 69 65 64 20 61  72 65 20 70 75 74 20 69  |iplied are put i|
00001bd0  6e 74 6f 0d 0e e2 35 5c  20 20 6d 75 6c 74 69 70  |nto...5\  multip|
00001be0  6c 69 63 61 6e 64 20 61  6e 64 20 6d 75 6c 74 69  |licand and multi|
00001bf0  70 6c 69 65 72 2e 20 20  70 70 77 73 20 69 73 20  |plier.  ppws is |
00001c00  75 73 65 64 20 66 6f 72  0d 0e ec 39 5c 20 20 70  |used for...9\  p|
00001c10  61 72 74 69 61 6c 20 70  72 6f 64 75 63 74 2e 20  |artial product. |
00001c20  52 65 73 75 6c 74 20 69  73 20 70 75 74 20 69 6e  |Result is put in|
00001c30  74 6f 20 6d 75 6c 74 69  70 6c 69 65 72 20 62 75  |to multiplier bu|
00001c40  74 0d 0e f6 3c 5c 20 20  72 65 61 64 20 66 72 6f  |t...<\  read fro|
00001c50  6d 20 27 6d 75 6c 74 69  70 6c 69 65 72 20 2b 32  |m 'multiplier +2|
00001c60  27 20 28 27 66 78 70 5f  72 65 73 27 29 20 66 6f  |' ('fxp_res') fo|
00001c70  72 20 66 69 78 65 64 20  70 6f 69 6e 74 0d 0f 00  |r fixed point...|
00001c80  3b 5c 20 20 57 6f 72 6b  73 70 61 63 65 20 69 73  |;\  Workspace is|
00001c90  20 69 6e 20 7a 65 72 6f  20 70 61 67 65 20 66 72  | in zero page fr|
00001ca0  6f 6d 20 26 37 30 20 73  6f 20 74 68 65 20 6c 61  |om &70 so the la|
00001cb0  62 65 6c 73 20 61 72 65  0d 0f 0a 34 5c 20 20 73  |bels are...4\  s|
00001cc0  65 74 20 75 73 69 6e 67  20 42 41 53 49 43 20 61  |et using BASIC a|
00001cd0  74 20 74 68 65 20 73 74  61 72 74 20 6f 66 20 74  |t the start of t|
00001ce0  68 65 20 61 73 73 65 6d  62 6c 65 72 0d 0f 14 05  |he assembler....|
00001cf0  20 0d 0f 1e 0a 4c 44 41  20 23 30 0d 0f 28 3b 53  | ....LDA #0..(;S|
00001d00  54 41 20 70 70 77 73 20  20 20 20 20 20 20 20 20  |TA ppws         |
00001d10  20 20 20 20 20 5c 20 43  6c 65 61 72 20 70 61 72  |     \ Clear par|
00001d20  74 69 61 6c 20 70 72 6f  64 75 63 74 20 77 6f 72  |tial product wor|
00001d30  6b 73 70 61 63 65 0d 0f  32 0e 53 54 41 20 70 70  |kspace..2.STA pp|
00001d40  77 73 2b 31 0d 0f 3c 0e  53 54 41 20 70 70 77 73  |ws+1..<.STA ppws|
00001d50  2b 32 0d 0f 46 0e 53 54  41 20 70 70 77 73 2b 33  |+2..F.STA ppws+3|
00001d60  0d 0f 50 0e 53 54 41 20  70 70 77 73 2b 34 0d 0f  |..P.STA ppws+4..|
00001d70  5a 14 53 54 41 20 6d 75  6c 74 69 70 6c 69 65 72  |Z.STA multiplier|
00001d80  2b 34 0d 0f 64 16 53 54  41 20 6d 75 6c 74 69 70  |+4..d.STA multip|
00001d90  6c 69 63 61 6e 64 2b 34  0d 0f 6e 14 53 54 41 20  |licand+4..n.STA |
00001da0  6d 75 6c 74 69 70 6c 69  65 72 2b 35 0d 0f 78 05  |multiplier+5..x.|
00001db0  20 0d 0f 82 38 4c 44 41  20 6d 75 6c 74 69 70 6c  | ...8LDA multipl|
00001dc0  69 65 72 2b 33 20 20 20  20 20 20 5c 20 54 65 73  |ier+3      \ Tes|
00001dd0  74 20 6d 75 6c 74 69 70  6c 69 65 72 20 66 6f 72  |t multiplier for|
00001de0  20 6e 65 67 61 74 69 76  65 0d 0f 8c 16 42 50 4c  | negative....BPL|
00001df0  20 6d 75 6c 74 69 70 6c  69 65 72 5f 70 6f 73 0d  | multiplier_pos.|
00001e00  0f 96 2f 44 45 43 20 6d  75 6c 74 69 70 6c 69 65  |../DEC multiplie|
00001e10  72 2b 34 20 20 20 20 20  20 5c 20 4d 61 6b 65 20  |r+4      \ Make |
00001e20  74 6f 70 20 62 79 74 65  20 3d 20 26 46 46 0d 0f  |top byte = &FF..|
00001e30  a0 05 20 0d 0f aa 13 2e  6d 75 6c 74 69 70 6c 69  |.. .....multipli|
00001e40  65 72 5f 70 6f 73 0d 0f  b4 05 20 0d 0f be 33 4c  |er_pos.... ...3L|
00001e50  44 41 20 6d 75 6c 74 69  70 6c 69 63 61 6e 64 2b  |DA multiplicand+|
00001e60  33 20 20 20 20 5c 20 52  65 70 65 61 74 20 66 6f  |3    \ Repeat fo|
00001e70  72 20 6d 75 6c 74 69 70  6c 69 63 61 6e 64 0d 0f  |r multiplicand..|
00001e80  c8 18 42 50 4c 20 6d 75  6c 74 69 70 6c 69 63 61  |..BPL multiplica|
00001e90  6e 64 5f 70 6f 73 0d 0f  d2 16 44 45 43 20 6d 75  |nd_pos....DEC mu|
00001ea0  6c 74 69 70 6c 69 63 61  6e 64 2b 34 0d 0f dc 05  |ltiplicand+4....|
00001eb0  20 0d 0f e6 15 2e 6d 75  6c 74 69 70 6c 69 63 61  | .....multiplica|
00001ec0  6e 64 5f 70 6f 73 0d 0f  f0 05 20 0d 0f fa 44 4c  |nd_pos.... ...DL|
00001ed0  44 58 20 23 34 30 20 20  20 20 20 20 20 20 20 20  |DX #40          |
00001ee0  20 20 20 20 20 5c 20 43  61 72 72 79 20 6f 75 74  |     \ Carry out|
00001ef0  20 34 30 20 74 69 6d 65  73 20 66 6f 72 20 34 30  | 40 times for 40|
00001f00  20 62 69 74 20 61 72 69  74 68 6d 65 74 69 63 0d  | bit arithmetic.|
00001f10  10 04 05 20 0d 10 0e 14  4c 53 52 20 6d 75 6c 74  |... ....LSR mult|
00001f20  69 70 6c 69 65 72 2b 34  0d 10 18 14 52 4f 52 20  |iplier+4....ROR |
00001f30  6d 75 6c 74 69 70 6c 69  65 72 2b 33 0d 10 22 14  |multiplier+3..".|
00001f40  52 4f 52 20 6d 75 6c 74  69 70 6c 69 65 72 2b 32  |ROR multiplier+2|
00001f50  0d 10 2c 14 52 4f 52 20  6d 75 6c 74 69 70 6c 69  |..,.ROR multipli|
00001f60  65 72 2b 31 0d 10 36 12  52 4f 52 20 6d 75 6c 74  |er+1..6.ROR mult|
00001f70  69 70 6c 69 65 72 0d 10  40 05 20 0d 10 4a 0e 2e  |iplier..@. ..J..|
00001f80  66 78 70 6d 5f 6c 6f 6f  70 0d 10 54 05 20 0d 10  |fxpm_loop..T. ..|
00001f90  5e 3a 42 43 43 20 6e 6f  5f 61 64 64 5f 66 78 70  |^:BCC no_add_fxp|
00001fa0  6d 20 20 20 20 20 20 20  5c 20 49 73 20 6e 65 78  |m       \ Is nex|
00001fb0  74 20 62 69 74 20 6f 66  20 6d 75 6c 74 69 70 6c  |t bit of multipl|
00001fc0  69 65 72 20 73 65 74 3f  0d 10 68 07 43 4c 43 0d  |ier set?..h.CLC.|
00001fd0  10 72 2c 4c 44 41 20 6d  75 6c 74 69 70 6c 69 63  |.r,LDA multiplic|
00001fe0  61 6e 64 20 20 20 20 20  20 5c 20 41 64 64 20 6d  |and      \ Add m|
00001ff0  75 6c 74 69 70 6c 69 63  61 6e 64 0d 10 7c 0c 41  |ultiplicand..|.A|
00002000  44 43 20 70 70 77 73 0d  10 86 0c 53 54 41 20 70  |DC ppws....STA p|
00002010  70 77 73 0d 10 90 16 4c  44 41 20 6d 75 6c 74 69  |pws....LDA multi|
00002020  70 6c 69 63 61 6e 64 2b  31 0d 10 9a 0e 41 44 43  |plicand+1....ADC|
00002030  20 70 70 77 73 2b 31 0d  10 a4 0e 53 54 41 20 70  | ppws+1....STA p|
00002040  70 77 73 2b 31 0d 10 ae  16 4c 44 41 20 6d 75 6c  |pws+1....LDA mul|
00002050  74 69 70 6c 69 63 61 6e  64 2b 32 0d 10 b8 0e 41  |tiplicand+2....A|
00002060  44 43 20 70 70 77 73 2b  32 0d 10 c2 0e 53 54 41  |DC ppws+2....STA|
00002070  20 70 70 77 73 2b 32 0d  10 cc 16 4c 44 41 20 6d  | ppws+2....LDA m|
00002080  75 6c 74 69 70 6c 69 63  61 6e 64 2b 33 0d 10 d6  |ultiplicand+3...|
00002090  0e 41 44 43 20 70 70 77  73 2b 33 0d 10 e0 0e 53  |.ADC ppws+3....S|
000020a0  54 41 20 70 70 77 73 2b  33 0d 10 ea 16 4c 44 41  |TA ppws+3....LDA|
000020b0  20 6d 75 6c 74 69 70 6c  69 63 61 6e 64 2b 34 0d  | multiplicand+4.|
000020c0  10 f4 0e 41 44 43 20 70  70 77 73 2b 34 0d 10 fe  |...ADC ppws+4...|
000020d0  0e 53 54 41 20 70 70 77  73 2b 34 0d 11 08 05 20  |.STA ppws+4.... |
000020e0  0d 11 12 10 2e 6e 6f 5f  61 64 64 5f 66 78 70 6d  |.....no_add_fxpm|
000020f0  0d 11 1c 05 20 0d 11 26  42 4c 53 52 20 70 70 77  |.... ..&BLSR ppw|
00002100  73 2b 34 20 20 20 20 20  20 20 20 20 20 20 20 5c  |s+4            \|
00002110  20 52 6f 74 61 74 65 20  28 73 68 69 66 74 29 20  | Rotate (shift) |
00002120  70 70 77 73 20 26 20 6d  75 6c 74 69 70 6c 69 65  |ppws & multiplie|
00002130  72 20 72 69 67 68 74 0d  11 30 0e 52 4f 52 20 70  |r right..0.ROR p|
00002140  70 77 73 2b 33 0d 11 3a  0e 52 4f 52 20 70 70 77  |pws+3..:.ROR ppw|
00002150  73 2b 32 0d 11 44 0e 52  4f 52 20 70 70 77 73 2b  |s+2..D.ROR ppws+|
00002160  31 0d 11 4e 0c 52 4f 52  20 70 70 77 73 0d 11 58  |1..N.ROR ppws..X|
00002170  14 52 4f 52 20 6d 75 6c  74 69 70 6c 69 65 72 2b  |.ROR multiplier+|
00002180  34 0d 11 62 14 52 4f 52  20 6d 75 6c 74 69 70 6c  |4..b.ROR multipl|
00002190  69 65 72 2b 33 0d 11 6c  14 52 4f 52 20 6d 75 6c  |ier+3..l.ROR mul|
000021a0  74 69 70 6c 69 65 72 2b  32 0d 11 76 14 52 4f 52  |tiplier+2..v.ROR|
000021b0  20 6d 75 6c 74 69 70 6c  69 65 72 2b 31 0d 11 80  | multiplier+1...|
000021c0  12 52 4f 52 20 6d 75 6c  74 69 70 6c 69 65 72 0d  |.ROR multiplier.|
000021d0  11 8a 39 44 45 58 20 20  20 20 20 20 20 20 20 20  |..9DEX          |
000021e0  20 20 20 20 20 20 20 20  20 5c 20 43 6f 75 6e 74  |         \ Count|
000021f0  69 6e 67 20 64 6f 77 6e  20 66 72 6f 6d 20 33 32  |ing down from 32|
00002200  20 74 6f 20 7a 65 72 6f  0d 11 94 11 42 4e 45 20  | to zero....BNE |
00002210  66 78 70 6d 5f 6c 6f 6f  70 0d 11 9e 05 20 0d 11  |fxpm_loop.... ..|
00002220  a8 14 4c 44 41 20 6d 75  6c 74 69 70 6c 69 65 72  |..LDA multiplier|
00002230  2b 34 0d 11 b2 0f 42 50  4c 20 72 65 73 5f 70 6f  |+4....BPL res_po|
00002240  73 0d 11 bc 14 44 45 43  20 6d 75 6c 74 69 70 6c  |s....DEC multipl|
00002250  69 65 72 2b 35 0d 11 c6  05 20 0d 11 d0 0c 2e 72  |ier+5.... .....r|
00002260  65 73 5f 70 6f 73 0d 11  da 05 20 0d 11 e4 07 52  |es_pos.... ....R|
00002270  54 53 0d 11 ee 05 20 0d  11 f8 05 5d 0d 12 02 05  |TS.... ....]....|
00002280  ed 0d 12 0c 2e f1 22 41  73 73 65 6d 62 6c 79 20  |......"Assembly |
00002290  63 6f 6d 70 6c 65 74 65  2c 20 70 72 65 73 73 20  |complete, press |
000022a0  66 30 20 74 6f 20 65 78  65 63 75 74 65 2e 22 0d  |f0 to execute.".|
000022b0  12 16 05 e0 0d 12 20 05  20 0d 12 2a 1b 2a 2a 2a  |...... . ..*.***|
000022c0  2a 20 45 51 55 61 74 65  20 61 20 42 79 74 65 20  |* EQUate a Byte |
000022d0  2a 2a 2a 2a 0d 12 34 0f  dd 20 a4 45 51 55 42 28  |****..4.. .EQUB(|
000022e0  4e 25 29 0d 12 3e 10 3f  50 25 3d 4e 25 20 83 20  |N%)..>.?P%=N% . |
000022f0  32 35 36 0d 12 48 1e e7  20 28 70 61 73 73 25 20  |256..H.. (pass% |
00002300  80 20 33 29 20 3d 20 33  20 8c 20 f1 20 7e 3f 50  |. 3) = 3 . . ~?P|
00002310  25 0d 12 52 0b 50 25 3d  50 25 2b 31 0d 12 5c 0a  |%..R.P%=P%+1..\.|
00002320  3d 70 61 73 73 25 0d 12  66 05 20 0d 12 70 25 2a  |=pass%..f. ..p%*|
00002330  2a 2a 2a 20 45 51 55 61  74 65 20 61 20 57 6f 72  |*** EQUate a Wor|
00002340  64 20 28 32 20 62 79 74  65 73 29 20 2a 2a 2a 2a  |d (2 bytes) ****|
00002350  0d 12 7a 0f dd 20 a4 45  51 55 57 28 4e 25 29 0d  |..z.. .EQUW(N%).|
00002360  12 84 10 3f 50 25 3d 4e  25 20 83 20 32 35 36 0d  |...?P%=N% . 256.|
00002370  12 8e 11 50 25 3f 31 3d  4e 25 20 81 20 32 35 36  |...P%?1=N% . 256|
00002380  0d 12 98 27 e7 20 28 70  61 73 73 25 20 80 20 33  |...'. (pass% . 3|
00002390  29 20 3d 20 33 20 8c 20  f1 20 7e 3f 50 25 2c 7e  |) = 3 . . ~?P%,~|
000023a0  3f 28 50 25 2b 31 29 0d  12 a2 0b 50 25 3d 50 25  |?(P%+1)....P%=P%|
000023b0  2b 32 0d 12 ac 0a 3d 70  61 73 73 25 0d 12 b6 05  |+2....=pass%....|
000023c0  20 0d 12 c0 2c 2a 2a 2a  2a 20 45 51 55 61 74 65  | ...,**** EQUate|
000023d0  20 61 20 44 6f 75 62 6c  65 20 77 6f 72 64 20 28  | a Double word (|
000023e0  34 20 62 79 74 65 73 29  20 2a 2a 2a 2a 0d 12 ca  |4 bytes) ****...|
000023f0  0f dd 20 a4 45 51 55 44  28 4e 25 29 0d 12 d4 08  |.. .EQUD(N%)....|
00002400  ea 20 58 25 0d 12 de 0a  21 50 25 3d 4e 25 0d 12  |. X%....!P%=N%..|
00002410  e8 0e e3 20 58 25 3d 30  20 b8 20 33 0d 12 f2 21  |... X%=0 . 3...!|
00002420  e7 20 28 70 61 73 73 25  20 80 20 33 29 20 3d 20  |. (pass% . 3) = |
00002430  33 20 8c 20 f1 20 7e 50  25 3f 58 25 3b 0d 12 fc  |3 . . ~P%?X%;...|
00002440  05 ed 0d 13 06 19 e7 20  28 70 61 73 73 25 20 80  |....... (pass% .|
00002450  20 33 29 20 3d 20 33 20  8c 20 f1 0d 13 10 0b 50  | 3) = 3 . .....P|
00002460  25 3d 50 25 2b 34 0d 13  1a 0a 3d 70 61 73 73 25  |%=P%+4....=pass%|
00002470  0d ff                                             |..|
00002472
09-04-88/B\OSB21.m0
09-04-88/B\OSB21.m1
09-04-88/B\OSB21.m2
09-04-88/B\OSB21.m4
09-04-88/B\OSB21.m5