Home » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_33.ADF » P/EDIT

P/EDIT

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 » Personal collection » Acorn ADFS disks » Electron_User_Group » EUG_33.ADF
Filename: P/EDIT
Read OK:
File size: 14E2 bytes
Load address: FFFF0E00
Exec address: FFFF802B
Duplicates

There are 2 duplicate copies of this file in the archive:

File contents
   10REM Editload V3.05
   20REM Edit (C)1995-1997 SPROW
   30*FX3,4
   40*TV255
   50*FX12,2
   60*FX4,1
   70MODE7:HIMEM=&2FFF
   80PRINT"20k Mode 0 screen editor":PRINT'"(C)1995-1997 R.Sprowson"
   90PRINT'"The final file will be saved to the     current filing system as 'OUTPUT'"
  100PRINT'"Choose: L)oad old file or N)ew"
  110REPEAT:key%=GET AND&DF
  120IFkey%=ASC"L" THENPROCload
  130IFkey%=ASC"N" THENPROCnew
  140UNTILkey%=ASC"L" ORkey%=ASC"N"
  150VDU23,1,0;0;0;0;:PROCasm(&900):REM Turn off cursor
  160X%=0:Y%=0:P%=0:Q%=0:CALL C%:REM Dot at point 0,0
  170ONERROROFF
  180CHAIN"EDITCRE"
  190:
  200DEFPROCasm(addr%)
  210REM Speed dependant parts
  220xhi=&461:xlo=&460:REM BASICs X%
  230yhi=&465:ylo=&464:REM BASICs Y%
  240phi=&441:plo=&440:REM BASICs P%
  250qhi=&445:qlo=&444:REM BASICs Q%
  260osby=&FFF4:oswd=&FFF1
  270eor=&59:or=&19:and=&39:REM opcodes
  280FORX=0 TO2 STEP2
  290P%=addr%
  300[OPTX
  310\*********
  320\Vert line
  330.V%
  340.takeYlo
  350LDAylo:SEC:SBCqlo:\Take low bytes
  360STAresL:\Save 1st half of answer
  370.takeYhi
  380PHP:LDAyhi:PLP:SBCqhi:\Take high bytes
  390STAresH:\Save 2nd half of answer
  400ORAresL:BEQexitY:\Exit if they're equal
  410.orderY
  420LDAresH:BMIsteppY
  430.stepnY
  440\-ve step,Y to Q,as Q<Y
  450JSRswapYnQ:JSRsteppY:JMPswapYnQ
  460.steppY
  470LDAyhi:PHA:LDAylo:PHA
  480DECylo:LDAylo:CMP#255:BNEincY:DECyhi
  490\+ve step,Y to Q,as Q>Y
  500.incY
  510INCylo:BNEoutputY:INCyhi
  520.outputY
  530JSR T%:BCStestY:JSR C%
  540.testY
  550LDAylo:CMPqlo:BNEincY:LDAyhi:CMPqhi:BNEincY
  560PLA:STAylo:PLA:STAyhi
  570.exitY
  580RTS
  590\**********
  600\Horiz line
  610.H%
  620.takeXlo
  630LDAxlo:SEC:SBCplo:\Take low bytes
  640STAresL:\Save 1st half of answer
  650.takeXhi
  660PHP:LDAxhi:PLP:SBCphi:\Take high bytes
  670STAresH:\Save 2nd half of answer
  680ORAresL:BEQexitX:\Exit if they're equal
  690.orderX
  700LDAresH:BMIsteppX
  710.stepnX:\If X>P
  720\-ve step,X to P,as P<X
  730JSRswapXnP:JSRsteppX:JMPswapXnP
  740.steppX
  750LDAxhi:PHA:LDAxlo:PHA
  760DECxlo:LDAxlo:CMP#255:BNEincX:DECxhi
  770\+ve step,X to P,as P>X
  780.incX
  790INCxlo:BNEoutputX:INCxhi
  800.outputX
  810JSR T%:BCStestX:JSR C%
  820.testX
  830LDAxlo:CMPplo:BNEincX:LDAxhi:CMPphi:BNEincX
  840PLA:STAxlo:PLA:STAxhi
  850.exitX
  860RTS
  870\***********
  880\Range check & adjust X%,Y%
  890.R%
  900.rangeL
  910LDAxhi:BPLrangeR:LDX#0:STXxlo:STXxhi:BEQoutofrange:\If X% is -ve then it is off the left so reset it to 0
  920.rangeR
  930LDAxhi:CMP#2:BNErangeW:LDAxlo:CMP#&80:BCCrangeT:LDX#2:STXxhi:LDX#&7F:STXxlo:BPLoutofrange:\If X%>=&280 then it is off the right so set it to &27F
  940.rangeW
  950CMP#3:BCCrangeT:LDX#2:STXxhi:LDX#&7F:STXxlo:BPLoutofrange:\If X%>&300 then it's well out
  960.rangeT
  970LDYyhi:BPLrangeB:LDY#0:STYylo:STYyhi:BEQoutofrange:\If Y% is -ve then it's off the top so reset to 0
  980.rangeB
  990LDYyhi:BEQrangedone:LDY#0:STYyhi:DEY:STYylo:\If Y%>=256 then it's off the bottom so reset to 255
 1000.outofrange
 1010SEC:RTS
 1020.rangedone
 1030CLC:RTS
 1040\***************
 1050\Test X%,Y% only
 1060.T%
 1070.testL
 1080LDAxhi:BMIoutofrange:\If X% is -ve then it is off the left
 1090.testR
 1100LDAxhi:CMP#2:BNEtestW:LDXxlo:CPX#&80:BCSoutofrange:\If X%>=&280 then it is off the right so set it to &27F
 1110.testW
 1120CMP#3:BCSoutofrange:\If X%>&300 then it's well out
 1130.testT
 1140LDYyhi:BNEoutofrange
 1150.testdone
 1160CLC:RTS
 1170\**********
 1180\Get pixel value
 1190.G%
 1200SEC:PHP:BCSlsbyte:\Reads at the end
 1210\**************
 1220\Calculate addr based on (X%,Y%)
 1230.C%
 1240CLC:PHP:\Writes at the end
 1250.lsbyte
 1260LDAylo:RORA:RORA:AND#(32+16+8+4+2):TAY:\Get Y co-ordinate,divide by 8 and multiply by 2
 1270LDAby640,Y:STApointer+2:INY:LDAby640,Y:STApointer+1:\Get *640 offset from lookup table
 1280LDAylo:AND#7:ORApointer+1:STApointer+1:\Add on Y MOD7
 1290LDAxlo:AND#(255-7):CLC:ADCpointer+1:STApointer+1:STAsaveit+1:\Save in 2 places
 1300BCCmsbyte:INCpointer+2:\Add on indent from left of screen adjusting hi byte too if C=1
 1310.msbyte
 1320LDAxhi:CLC:ADCpointer+2:\Has to be a two byte addition as X is from 0 to 639 not 0 to 255 (hence X will occupy 2 bits + 8 bits)
 1330ADC#&30:STApointer+2:STAsaveit+2:\Add on &3000 and save in 2 places
 1340\*******************
 1350\See what power of 2 is asked for by X%
 1360LDAxlo:AND#7:TAY
 1370.pointer
 1380LDA&9999:PLP:BCClogic:RTS
 1390.logic
 1400EORpwrtwo,Y:\Logic operation defined by opcode here (default=EOR)
 1410.saveit
 1420STA&9999:RTS:\Rewrite new value to screen
 1430\**************
 1440\Swap variables
 1450.swapYnQ
 1460LDAqlo:PHA:LDAqhi:LDXylo:STXqlo:LDXyhi:STXqhi:STAyhi:PLA:STAylo:RTS
 1470.swapXnP
 1480LDAplo:PHA:LDAphi:LDXxlo:STXplo:LDXxhi:STXphi:STAxhi:PLA:STAxlo:RTS
 1490\***********
 1500\Data values
 1510.pwrtwo
 1520\Table of 2^n results
 1530EQUB128:EQUB64:EQUB32:EQUB16
 1540EQUB8:EQUB4:EQUB2:EQUB1
 1550.by640
 1560\Table of *640 results
 1570EQUD&80020000:EQUD&80070005
 1580EQUD&800C000A:EQUD&8011000F
 1590EQUD&80160014:EQUD&801B0019
 1600EQUD&8020001E:EQUD&80250023
 1610EQUD&802A0028:EQUD&802F002D
 1620EQUD&80340032:EQUD&80390037
 1630EQUD&803E003C:EQUD&80430041
 1640EQUD&80480046:EQUD&804D004B
 1650.resL
 1660\Workspace
 1670BRK
 1680.resH
 1690\Workspace
 1700BRK
 1710]
 1720NEXT
 1730ENDPROC
 1740:
 1750DEFPROCload
 1760ONERRORIFERR>127 THENPRINT:PRINT"Filing system error":wait%=INKEY(150):RUN ELSEPRINT:PRINT"Unexpected error":END:REM Filing system errors are >127 in general
 1770PRINT'"Insert source media into drive now":wait%=INKEY(500)
 1780PRINT:INPUT"Enter filename: "F$
 1790REM Try to open the file
 1800exist%=OPENIN F$:CLOSE#exist%
 1810IFexist%=FALSE THENPRINT'"Can't find file":wait%=INKEY(150):RUN
 1820PRINT'"Now loading...";F$:wait%=INKEY(150):VDU&16,0:OSCLI("LOAD "+F$+" 3000"):REM That's how to change MODE inside a PROC
 1830ENDPROC
 1840:
 1850DEFPROCnew
 1860PRINT:PRINT"Creating...":wait%=INKEY(150):VDU&16,0
 1870ENDPROC

� Editload V3.05
� Edit (C)1995-1997 SPROW

*FX3,4
(
*TV255
2*FX12,2
<
*FX4,1
F�7:�=&2FFF
P;�"20k Mode 0 screen editor":�'"(C)1995-1997 R.Sprowson"
ZQ�'"The final file will be saved to the     current filing system as 'OUTPUT'"
d&�'"Choose: L)oad old file or N)ew"
n�:key%=� �&DF
x�key%=�"L" ��load
��key%=�"N" ��new
��key%=�"L" �key%=�"N"
�/�23,1,0;0;0;0;:�asm(&900):� Turn off cursor
�/X%=0:Y%=0:P%=0:Q%=0:� C%:� Dot at point 0,0
�
��"EDITCRE"
�:
���asm(addr%)
�� Speed dependant parts
�!xhi=&461:xlo=&460:� BASICs X%
�!yhi=&465:ylo=&464:� BASICs Y%
�!phi=&441:plo=&440:� BASICs P%
�!qhi=&445:qlo=&444:� BASICs Q%
osby=&FFF4:oswd=&FFF1
$eor=&59:or=&19:and=&39:� opcodes
�X=0 �2 �2
"P%=addr%
,	[OPTX
6\*********
@\Vert line
J.V%
T.takeYlo
^%LDAylo:SEC:SBCqlo:\Take low bytes
h$STAresL:\Save 1st half of answer
r.takeYhi
|*PHP:LDAyhi:PLP:SBCqhi:\Take high bytes
�$STAresH:\Save 2nd half of answer
�*�AresL:BEQexitY:\Exit if they're equal
�.orderY
�LDAresH:BMIsteppY
�.stepnY
�\-ve step,Y to Q,as Q<Y
�#JSRswapYnQ:JSRsteppY:JMPswapYnQ
�.steppY
�LDAyhi:PHA:LDAylo:PHA
�(DECylo:LDAylo:CMP#255:BNEincY:DECyhi
�\+ve step,Y to Q,as Q>Y
�	.incY
�INCylo:BNEoutputY:INCyhi
.outputY
JSR T%:BCStestY:JSR C%

.testY
&/LDAylo:CMPqlo:BNEincY:LDAyhi:CMPqhi:BNEincY
0PLA:STAylo:PLA:STAyhi
:
.exitY
DRTS
N\**********
X\Horiz line
b.H%
l.takeXlo
v%LDAxlo:SEC:SBCplo:\Take low bytes
�$STAresL:\Save 1st half of answer
�.takeXhi
�*PHP:LDAxhi:PLP:SBCphi:\Take high bytes
�$STAresH:\Save 2nd half of answer
�*�AresL:BEQexitX:\Exit if they're equal
�.orderX
�LDAresH:BMIsteppX
�.stepnX:\If X>P
�\-ve step,X to P,as P<X
�#JSRswapXnP:JSRsteppX:JMPswapXnP
�.steppX
�LDAxhi:PHA:LDAxlo:PHA
�(DECxlo:LDAxlo:CMP#255:BNEincX:DECxhi
\+ve step,X to P,as P>X
	.incX
INCxlo:BNEoutputX:INCxhi
 .outputX
*JSR T%:BCStestX:JSR C%
4
.testX
>/LDAxlo:CMPplo:BNEincX:LDAxhi:CMPphi:BNEincX
HPLA:STAxlo:PLA:STAxhi
R
.exitX
\RTS
f\***********
p\Range check & adjust X%,Y%
z.R%
�.rangeL
�mLDAxhi:BPLrangeR:LDX#0:STXxlo:STXxhi:BEQoutofrange:\If X% is -ve then it is off the left so reset it to 0
�.rangeR
��LDAxhi:CMP#2:BNErangeW:LDAxlo:CMP#&80:BCCrangeT:LDX#2:STXxhi:LDX#&7F:STXxlo:BPLoutofrange:\If X%>=&280 then it is off the right so set it to &27F
�.rangeW
�\CMP#3:BCCrangeT:LDX#2:STXxhi:LDX#&7F:STXxlo:BPLoutofrange:\If X%>&300 then it's well out
�.rangeT
�hLDYyhi:BPLrangeB:LDY#0:STYylo:STYyhi:BEQoutofrange:\If Y% is -ve then it's off the top so reset to 0
�.rangeB
�dLDYyhi:BEQrangedone:LDY#0:STYyhi:DEY:STYylo:\If Y%>=256 then it's off the bottom so reset to 255
�.outofrange
�SEC:RTS
�.rangedone
CLC:RTS
\***************
\Test X%,Y% only
$.T%
.
.testL
8>LDAxhi:BMIoutofrange:\If X% is -ve then it is off the left
B
.testR
LnLDAxhi:CMP#2:BNEtestW:LDXxlo:CPX#&80:BCSoutofrange:\If X%>=&280 then it is off the right so set it to &27F
V
.testW
`6CMP#3:BCSoutofrange:\If X%>&300 then it's well out
j
.testT
tLDYyhi:BNEoutofrange
~
.testdone
�CLC:RTS
�\**********
�\Get pixel value
�.G%
�'SEC:PHP:BCSlsbyte:\Reads at the end
�\**************
�$\Calculate addr based on (X%,Y%)
�.C%
�CLC:PHP:\Writes at the end
�.lsbyte
�YLDAylo:RORA:RORA:�#(32+16+8+4+2):TAY:\Get Y co-ordinate,divide by 8 and multiply by 2
�ZLDAby640,Y:STApointer+2:INY:LDAby640,Y:STApointer+1:\Get *640 offset from lookup table
4LDAylo:�#7:�Apointer+1:STApointer+1:\Add on Y �7

PLDAxlo:�#(255-7):CLC:ADCpointer+1:STApointer+1:STAsaveit+1:\Save in 2 places
ZBCCmsbyte:INCpointer+2:\Add on indent from left of screen adjusting hi byte too if C=1
.msbyte
(�LDAxhi:CLC:ADCpointer+2:\Has to be a two byte addition as X is from 0 to 639 not 0 to 255 (hence X will occupy 2 bits + 8 bits)
2GADC#&30:STApointer+2:STAsaveit+2:\Add on &3000 and save in 2 places
<\*******************
F+\See what power of 2 is asked for by X%
PLDAxlo:�#7:TAY
Z.pointer
dLDA&9999:PLP:BCClogic:RTS
n
.logic
xA�pwrtwo,Y:\Logic operation defined by opcode here (default=�)
�.saveit
�-STA&9999:RTS:\Rewrite new value to screen
�\**************
�\Swap variables
�.swapYnQ
�GLDAqlo:PHA:LDAqhi:LDXylo:STXqlo:LDXyhi:STXqhi:STAyhi:PLA:STAylo:RTS
�.swapXnP
�GLDAplo:PHA:LDAphi:LDXxlo:STXplo:LDXxhi:STXphi:STAxhi:PLA:STAxlo:RTS
�\***********
�\Data values
�.pwrtwo
�\Table of 2^n results
� EQUB128:EQUB64:EQUB32:EQUB16
EQUB8:EQUB4:EQUB2:EQUB1

.by640
\Table of *640 results
"EQUD&80020000:EQUD&80070005
,EQUD&800C000A:EQUD&8011000F
6EQUD&80160014:EQUD&801B0019
@EQUD&8020001E:EQUD&80250023
JEQUD&802A0028:EQUD&802F002D
TEQUD&80340032:EQUD&80390037
^EQUD&803E003C:EQUD&80430041
hEQUD&80480046:EQUD&804D004B
r	.resL
|\Workspace
�BRK
�	.resH
�\Workspace
�BRK
�]
��
��
�:
�
��load
�y��>127 ��:�"Filing system error":wait%=�(150):� ��:�"Unexpected error":�:� Filing system errors are >127 in general
�7�'"Insert source media into drive now":wait%=�(500)
��:�"Enter filename: "F$
�� Try to open the file
exist%=� F$:�#exist%
1�exist%=� ��'"Can't find file":wait%=�(150):�
m�'"Now loading...";F$:wait%=�(150):�&16,0:�("LOAD "+F$+" 3000"):� That's how to change MODE inside a PROC
&�
0:
:	��new
D(�:�"Creating...":wait%=�(150):�&16,0
N�
�
00000000  0d 00 0a 14 f4 20 45 64  69 74 6c 6f 61 64 20 56  |..... Editload V|
00000010  33 2e 30 35 0d 00 14 1d  f4 20 45 64 69 74 20 28  |3.05..... Edit (|
00000020  43 29 31 39 39 35 2d 31  39 39 37 20 53 50 52 4f  |C)1995-1997 SPRO|
00000030  57 0d 00 1e 0a 2a 46 58  33 2c 34 0d 00 28 0a 2a  |W....*FX3,4..(.*|
00000040  54 56 32 35 35 0d 00 32  0b 2a 46 58 31 32 2c 32  |TV255..2.*FX12,2|
00000050  0d 00 3c 0a 2a 46 58 34  2c 31 0d 00 46 0e eb 37  |..<.*FX4,1..F..7|
00000060  3a d3 3d 26 32 46 46 46  0d 00 50 3b f1 22 32 30  |:.=&2FFF..P;."20|
00000070  6b 20 4d 6f 64 65 20 30  20 73 63 72 65 65 6e 20  |k Mode 0 screen |
00000080  65 64 69 74 6f 72 22 3a  f1 27 22 28 43 29 31 39  |editor":.'"(C)19|
00000090  39 35 2d 31 39 39 37 20  52 2e 53 70 72 6f 77 73  |95-1997 R.Sprows|
000000a0  6f 6e 22 0d 00 5a 51 f1  27 22 54 68 65 20 66 69  |on"..ZQ.'"The fi|
000000b0  6e 61 6c 20 66 69 6c 65  20 77 69 6c 6c 20 62 65  |nal file will be|
000000c0  20 73 61 76 65 64 20 74  6f 20 74 68 65 20 20 20  | saved to the   |
000000d0  20 20 63 75 72 72 65 6e  74 20 66 69 6c 69 6e 67  |  current filing|
000000e0  20 73 79 73 74 65 6d 20  61 73 20 27 4f 55 54 50  | system as 'OUTP|
000000f0  55 54 27 22 0d 00 64 26  f1 27 22 43 68 6f 6f 73  |UT'"..d&.'"Choos|
00000100  65 3a 20 4c 29 6f 61 64  20 6f 6c 64 20 66 69 6c  |e: L)oad old fil|
00000110  65 20 6f 72 20 4e 29 65  77 22 0d 00 6e 11 f5 3a  |e or N)ew"..n..:|
00000120  6b 65 79 25 3d a5 20 80  26 44 46 0d 00 78 15 e7  |key%=. .&DF..x..|
00000130  6b 65 79 25 3d 97 22 4c  22 20 8c f2 6c 6f 61 64  |key%=."L" ..load|
00000140  0d 00 82 14 e7 6b 65 79  25 3d 97 22 4e 22 20 8c  |.....key%=."N" .|
00000150  f2 6e 65 77 0d 00 8c 19  fd 6b 65 79 25 3d 97 22  |.new.....key%=."|
00000160  4c 22 20 84 6b 65 79 25  3d 97 22 4e 22 0d 00 96  |L" .key%=."N"...|
00000170  2f ef 32 33 2c 31 2c 30  3b 30 3b 30 3b 30 3b 3a  |/.23,1,0;0;0;0;:|
00000180  f2 61 73 6d 28 26 39 30  30 29 3a f4 20 54 75 72  |.asm(&900):. Tur|
00000190  6e 20 6f 66 66 20 63 75  72 73 6f 72 0d 00 a0 2f  |n off cursor.../|
000001a0  58 25 3d 30 3a 59 25 3d  30 3a 50 25 3d 30 3a 51  |X%=0:Y%=0:P%=0:Q|
000001b0  25 3d 30 3a d6 20 43 25  3a f4 20 44 6f 74 20 61  |%=0:. C%:. Dot a|
000001c0  74 20 70 6f 69 6e 74 20  30 2c 30 0d 00 aa 07 ee  |t point 0,0.....|
000001d0  85 87 0d 00 b4 0e d7 22  45 44 49 54 43 52 45 22  |......."EDITCRE"|
000001e0  0d 00 be 05 3a 0d 00 c8  10 dd f2 61 73 6d 28 61  |....:......asm(a|
000001f0  64 64 72 25 29 0d 00 d2  1b f4 20 53 70 65 65 64  |ddr%)..... Speed|
00000200  20 64 65 70 65 6e 64 61  6e 74 20 70 61 72 74 73  | dependant parts|
00000210  0d 00 dc 21 78 68 69 3d  26 34 36 31 3a 78 6c 6f  |...!xhi=&461:xlo|
00000220  3d 26 34 36 30 3a f4 20  42 41 53 49 43 73 20 58  |=&460:. BASICs X|
00000230  25 0d 00 e6 21 79 68 69  3d 26 34 36 35 3a 79 6c  |%...!yhi=&465:yl|
00000240  6f 3d 26 34 36 34 3a f4  20 42 41 53 49 43 73 20  |o=&464:. BASICs |
00000250  59 25 0d 00 f0 21 70 68  69 3d 26 34 34 31 3a 70  |Y%...!phi=&441:p|
00000260  6c 6f 3d 26 34 34 30 3a  f4 20 42 41 53 49 43 73  |lo=&440:. BASICs|
00000270  20 50 25 0d 00 fa 21 71  68 69 3d 26 34 34 35 3a  | P%...!qhi=&445:|
00000280  71 6c 6f 3d 26 34 34 34  3a f4 20 42 41 53 49 43  |qlo=&444:. BASIC|
00000290  73 20 51 25 0d 01 04 19  6f 73 62 79 3d 26 46 46  |s Q%....osby=&FF|
000002a0  46 34 3a 6f 73 77 64 3d  26 46 46 46 31 0d 01 0e  |F4:oswd=&FFF1...|
000002b0  24 65 6f 72 3d 26 35 39  3a 6f 72 3d 26 31 39 3a  |$eor=&59:or=&19:|
000002c0  61 6e 64 3d 26 33 39 3a  f4 20 6f 70 63 6f 64 65  |and=&39:. opcode|
000002d0  73 0d 01 18 0e e3 58 3d  30 20 b8 32 20 88 32 0d  |s.....X=0 .2 .2.|
000002e0  01 22 0c 50 25 3d 61 64  64 72 25 0d 01 2c 09 5b  |.".P%=addr%..,.[|
000002f0  4f 50 54 58 0d 01 36 0e  5c 2a 2a 2a 2a 2a 2a 2a  |OPTX..6.\*******|
00000300  2a 2a 0d 01 40 0e 5c 56  65 72 74 20 6c 69 6e 65  |**..@.\Vert line|
00000310  0d 01 4a 07 2e 56 25 0d  01 54 0c 2e 74 61 6b 65  |..J..V%..T..take|
00000320  59 6c 6f 0d 01 5e 25 4c  44 41 79 6c 6f 3a 53 45  |Ylo..^%LDAylo:SE|
00000330  43 3a 53 42 43 71 6c 6f  3a 5c 54 61 6b 65 20 6c  |C:SBCqlo:\Take l|
00000340  6f 77 20 62 79 74 65 73  0d 01 68 24 53 54 41 72  |ow bytes..h$STAr|
00000350  65 73 4c 3a 5c 53 61 76  65 20 31 73 74 20 68 61  |esL:\Save 1st ha|
00000360  6c 66 20 6f 66 20 61 6e  73 77 65 72 0d 01 72 0c  |lf of answer..r.|
00000370  2e 74 61 6b 65 59 68 69  0d 01 7c 2a 50 48 50 3a  |.takeYhi..|*PHP:|
00000380  4c 44 41 79 68 69 3a 50  4c 50 3a 53 42 43 71 68  |LDAyhi:PLP:SBCqh|
00000390  69 3a 5c 54 61 6b 65 20  68 69 67 68 20 62 79 74  |i:\Take high byt|
000003a0  65 73 0d 01 86 24 53 54  41 72 65 73 48 3a 5c 53  |es...$STAresH:\S|
000003b0  61 76 65 20 32 6e 64 20  68 61 6c 66 20 6f 66 20  |ave 2nd half of |
000003c0  61 6e 73 77 65 72 0d 01  90 2a 84 41 72 65 73 4c  |answer...*.AresL|
000003d0  3a 42 45 51 65 78 69 74  59 3a 5c 45 78 69 74 20  |:BEQexitY:\Exit |
000003e0  69 66 20 74 68 65 79 27  72 65 20 65 71 75 61 6c  |if they're equal|
000003f0  0d 01 9a 0b 2e 6f 72 64  65 72 59 0d 01 a4 15 4c  |.....orderY....L|
00000400  44 41 72 65 73 48 3a 42  4d 49 73 74 65 70 70 59  |DAresH:BMIsteppY|
00000410  0d 01 ae 0b 2e 73 74 65  70 6e 59 0d 01 b8 1b 5c  |.....stepnY....\|
00000420  2d 76 65 20 73 74 65 70  2c 59 20 74 6f 20 51 2c  |-ve step,Y to Q,|
00000430  61 73 20 51 3c 59 0d 01  c2 23 4a 53 52 73 77 61  |as Q<Y...#JSRswa|
00000440  70 59 6e 51 3a 4a 53 52  73 74 65 70 70 59 3a 4a  |pYnQ:JSRsteppY:J|
00000450  4d 50 73 77 61 70 59 6e  51 0d 01 cc 0b 2e 73 74  |MPswapYnQ.....st|
00000460  65 70 70 59 0d 01 d6 19  4c 44 41 79 68 69 3a 50  |eppY....LDAyhi:P|
00000470  48 41 3a 4c 44 41 79 6c  6f 3a 50 48 41 0d 01 e0  |HA:LDAylo:PHA...|
00000480  28 44 45 43 79 6c 6f 3a  4c 44 41 79 6c 6f 3a 43  |(DECylo:LDAylo:C|
00000490  4d 50 23 32 35 35 3a 42  4e 45 69 6e 63 59 3a 44  |MP#255:BNEincY:D|
000004a0  45 43 79 68 69 0d 01 ea  1b 5c 2b 76 65 20 73 74  |ECyhi....\+ve st|
000004b0  65 70 2c 59 20 74 6f 20  51 2c 61 73 20 51 3e 59  |ep,Y to Q,as Q>Y|
000004c0  0d 01 f4 09 2e 69 6e 63  59 0d 01 fe 1c 49 4e 43  |.....incY....INC|
000004d0  79 6c 6f 3a 42 4e 45 6f  75 74 70 75 74 59 3a 49  |ylo:BNEoutputY:I|
000004e0  4e 43 79 68 69 0d 02 08  0c 2e 6f 75 74 70 75 74  |NCyhi.....output|
000004f0  59 0d 02 12 1a 4a 53 52  20 54 25 3a 42 43 53 74  |Y....JSR T%:BCSt|
00000500  65 73 74 59 3a 4a 53 52  20 43 25 0d 02 1c 0a 2e  |estY:JSR C%.....|
00000510  74 65 73 74 59 0d 02 26  2f 4c 44 41 79 6c 6f 3a  |testY..&/LDAylo:|
00000520  43 4d 50 71 6c 6f 3a 42  4e 45 69 6e 63 59 3a 4c  |CMPqlo:BNEincY:L|
00000530  44 41 79 68 69 3a 43 4d  50 71 68 69 3a 42 4e 45  |DAyhi:CMPqhi:BNE|
00000540  69 6e 63 59 0d 02 30 19  50 4c 41 3a 53 54 41 79  |incY..0.PLA:STAy|
00000550  6c 6f 3a 50 4c 41 3a 53  54 41 79 68 69 0d 02 3a  |lo:PLA:STAyhi..:|
00000560  0a 2e 65 78 69 74 59 0d  02 44 07 52 54 53 0d 02  |..exitY..D.RTS..|
00000570  4e 0f 5c 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 0d 02 58  |N.\**********..X|
00000580  0f 5c 48 6f 72 69 7a 20  6c 69 6e 65 0d 02 62 07  |.\Horiz line..b.|
00000590  2e 48 25 0d 02 6c 0c 2e  74 61 6b 65 58 6c 6f 0d  |.H%..l..takeXlo.|
000005a0  02 76 25 4c 44 41 78 6c  6f 3a 53 45 43 3a 53 42  |.v%LDAxlo:SEC:SB|
000005b0  43 70 6c 6f 3a 5c 54 61  6b 65 20 6c 6f 77 20 62  |Cplo:\Take low b|
000005c0  79 74 65 73 0d 02 80 24  53 54 41 72 65 73 4c 3a  |ytes...$STAresL:|
000005d0  5c 53 61 76 65 20 31 73  74 20 68 61 6c 66 20 6f  |\Save 1st half o|
000005e0  66 20 61 6e 73 77 65 72  0d 02 8a 0c 2e 74 61 6b  |f answer.....tak|
000005f0  65 58 68 69 0d 02 94 2a  50 48 50 3a 4c 44 41 78  |eXhi...*PHP:LDAx|
00000600  68 69 3a 50 4c 50 3a 53  42 43 70 68 69 3a 5c 54  |hi:PLP:SBCphi:\T|
00000610  61 6b 65 20 68 69 67 68  20 62 79 74 65 73 0d 02  |ake high bytes..|
00000620  9e 24 53 54 41 72 65 73  48 3a 5c 53 61 76 65 20  |.$STAresH:\Save |
00000630  32 6e 64 20 68 61 6c 66  20 6f 66 20 61 6e 73 77  |2nd half of answ|
00000640  65 72 0d 02 a8 2a 84 41  72 65 73 4c 3a 42 45 51  |er...*.AresL:BEQ|
00000650  65 78 69 74 58 3a 5c 45  78 69 74 20 69 66 20 74  |exitX:\Exit if t|
00000660  68 65 79 27 72 65 20 65  71 75 61 6c 0d 02 b2 0b  |hey're equal....|
00000670  2e 6f 72 64 65 72 58 0d  02 bc 15 4c 44 41 72 65  |.orderX....LDAre|
00000680  73 48 3a 42 4d 49 73 74  65 70 70 58 0d 02 c6 13  |sH:BMIsteppX....|
00000690  2e 73 74 65 70 6e 58 3a  5c 49 66 20 58 3e 50 0d  |.stepnX:\If X>P.|
000006a0  02 d0 1b 5c 2d 76 65 20  73 74 65 70 2c 58 20 74  |...\-ve step,X t|
000006b0  6f 20 50 2c 61 73 20 50  3c 58 0d 02 da 23 4a 53  |o P,as P<X...#JS|
000006c0  52 73 77 61 70 58 6e 50  3a 4a 53 52 73 74 65 70  |RswapXnP:JSRstep|
000006d0  70 58 3a 4a 4d 50 73 77  61 70 58 6e 50 0d 02 e4  |pX:JMPswapXnP...|
000006e0  0b 2e 73 74 65 70 70 58  0d 02 ee 19 4c 44 41 78  |..steppX....LDAx|
000006f0  68 69 3a 50 48 41 3a 4c  44 41 78 6c 6f 3a 50 48  |hi:PHA:LDAxlo:PH|
00000700  41 0d 02 f8 28 44 45 43  78 6c 6f 3a 4c 44 41 78  |A...(DECxlo:LDAx|
00000710  6c 6f 3a 43 4d 50 23 32  35 35 3a 42 4e 45 69 6e  |lo:CMP#255:BNEin|
00000720  63 58 3a 44 45 43 78 68  69 0d 03 02 1b 5c 2b 76  |cX:DECxhi....\+v|
00000730  65 20 73 74 65 70 2c 58  20 74 6f 20 50 2c 61 73  |e step,X to P,as|
00000740  20 50 3e 58 0d 03 0c 09  2e 69 6e 63 58 0d 03 16  | P>X.....incX...|
00000750  1c 49 4e 43 78 6c 6f 3a  42 4e 45 6f 75 74 70 75  |.INCxlo:BNEoutpu|
00000760  74 58 3a 49 4e 43 78 68  69 0d 03 20 0c 2e 6f 75  |tX:INCxhi.. ..ou|
00000770  74 70 75 74 58 0d 03 2a  1a 4a 53 52 20 54 25 3a  |tputX..*.JSR T%:|
00000780  42 43 53 74 65 73 74 58  3a 4a 53 52 20 43 25 0d  |BCStestX:JSR C%.|
00000790  03 34 0a 2e 74 65 73 74  58 0d 03 3e 2f 4c 44 41  |.4..testX..>/LDA|
000007a0  78 6c 6f 3a 43 4d 50 70  6c 6f 3a 42 4e 45 69 6e  |xlo:CMPplo:BNEin|
000007b0  63 58 3a 4c 44 41 78 68  69 3a 43 4d 50 70 68 69  |cX:LDAxhi:CMPphi|
000007c0  3a 42 4e 45 69 6e 63 58  0d 03 48 19 50 4c 41 3a  |:BNEincX..H.PLA:|
000007d0  53 54 41 78 6c 6f 3a 50  4c 41 3a 53 54 41 78 68  |STAxlo:PLA:STAxh|
000007e0  69 0d 03 52 0a 2e 65 78  69 74 58 0d 03 5c 07 52  |i..R..exitX..\.R|
000007f0  54 53 0d 03 66 10 5c 2a  2a 2a 2a 2a 2a 2a 2a 2a  |TS..f.\*********|
00000800  2a 2a 0d 03 70 1f 5c 52  61 6e 67 65 20 63 68 65  |**..p.\Range che|
00000810  63 6b 20 26 20 61 64 6a  75 73 74 20 58 25 2c 59  |ck & adjust X%,Y|
00000820  25 0d 03 7a 07 2e 52 25  0d 03 84 0b 2e 72 61 6e  |%..z..R%.....ran|
00000830  67 65 4c 0d 03 8e 6d 4c  44 41 78 68 69 3a 42 50  |geL...mLDAxhi:BP|
00000840  4c 72 61 6e 67 65 52 3a  4c 44 58 23 30 3a 53 54  |LrangeR:LDX#0:ST|
00000850  58 78 6c 6f 3a 53 54 58  78 68 69 3a 42 45 51 6f  |Xxlo:STXxhi:BEQo|
00000860  75 74 6f 66 72 61 6e 67  65 3a 5c 49 66 20 58 25  |utofrange:\If X%|
00000870  20 69 73 20 2d 76 65 20  74 68 65 6e 20 69 74 20  | is -ve then it |
00000880  69 73 20 6f 66 66 20 74  68 65 20 6c 65 66 74 20  |is off the left |
00000890  73 6f 20 72 65 73 65 74  20 69 74 20 74 6f 20 30  |so reset it to 0|
000008a0  0d 03 98 0b 2e 72 61 6e  67 65 52 0d 03 a2 95 4c  |.....rangeR....L|
000008b0  44 41 78 68 69 3a 43 4d  50 23 32 3a 42 4e 45 72  |DAxhi:CMP#2:BNEr|
000008c0  61 6e 67 65 57 3a 4c 44  41 78 6c 6f 3a 43 4d 50  |angeW:LDAxlo:CMP|
000008d0  23 26 38 30 3a 42 43 43  72 61 6e 67 65 54 3a 4c  |#&80:BCCrangeT:L|
000008e0  44 58 23 32 3a 53 54 58  78 68 69 3a 4c 44 58 23  |DX#2:STXxhi:LDX#|
000008f0  26 37 46 3a 53 54 58 78  6c 6f 3a 42 50 4c 6f 75  |&7F:STXxlo:BPLou|
00000900  74 6f 66 72 61 6e 67 65  3a 5c 49 66 20 58 25 3e  |tofrange:\If X%>|
00000910  3d 26 32 38 30 20 74 68  65 6e 20 69 74 20 69 73  |=&280 then it is|
00000920  20 6f 66 66 20 74 68 65  20 72 69 67 68 74 20 73  | off the right s|
00000930  6f 20 73 65 74 20 69 74  20 74 6f 20 26 32 37 46  |o set it to &27F|
00000940  0d 03 ac 0b 2e 72 61 6e  67 65 57 0d 03 b6 5c 43  |.....rangeW...\C|
00000950  4d 50 23 33 3a 42 43 43  72 61 6e 67 65 54 3a 4c  |MP#3:BCCrangeT:L|
00000960  44 58 23 32 3a 53 54 58  78 68 69 3a 4c 44 58 23  |DX#2:STXxhi:LDX#|
00000970  26 37 46 3a 53 54 58 78  6c 6f 3a 42 50 4c 6f 75  |&7F:STXxlo:BPLou|
00000980  74 6f 66 72 61 6e 67 65  3a 5c 49 66 20 58 25 3e  |tofrange:\If X%>|
00000990  26 33 30 30 20 74 68 65  6e 20 69 74 27 73 20 77  |&300 then it's w|
000009a0  65 6c 6c 20 6f 75 74 0d  03 c0 0b 2e 72 61 6e 67  |ell out.....rang|
000009b0  65 54 0d 03 ca 68 4c 44  59 79 68 69 3a 42 50 4c  |eT...hLDYyhi:BPL|
000009c0  72 61 6e 67 65 42 3a 4c  44 59 23 30 3a 53 54 59  |rangeB:LDY#0:STY|
000009d0  79 6c 6f 3a 53 54 59 79  68 69 3a 42 45 51 6f 75  |ylo:STYyhi:BEQou|
000009e0  74 6f 66 72 61 6e 67 65  3a 5c 49 66 20 59 25 20  |tofrange:\If Y% |
000009f0  69 73 20 2d 76 65 20 74  68 65 6e 20 69 74 27 73  |is -ve then it's|
00000a00  20 6f 66 66 20 74 68 65  20 74 6f 70 20 73 6f 20  | off the top so |
00000a10  72 65 73 65 74 20 74 6f  20 30 0d 03 d4 0b 2e 72  |reset to 0.....r|
00000a20  61 6e 67 65 42 0d 03 de  64 4c 44 59 79 68 69 3a  |angeB...dLDYyhi:|
00000a30  42 45 51 72 61 6e 67 65  64 6f 6e 65 3a 4c 44 59  |BEQrangedone:LDY|
00000a40  23 30 3a 53 54 59 79 68  69 3a 44 45 59 3a 53 54  |#0:STYyhi:DEY:ST|
00000a50  59 79 6c 6f 3a 5c 49 66  20 59 25 3e 3d 32 35 36  |Yylo:\If Y%>=256|
00000a60  20 74 68 65 6e 20 69 74  27 73 20 6f 66 66 20 74  | then it's off t|
00000a70  68 65 20 62 6f 74 74 6f  6d 20 73 6f 20 72 65 73  |he bottom so res|
00000a80  65 74 20 74 6f 20 32 35  35 0d 03 e8 0f 2e 6f 75  |et to 255.....ou|
00000a90  74 6f 66 72 61 6e 67 65  0d 03 f2 0b 53 45 43 3a  |tofrange....SEC:|
00000aa0  52 54 53 0d 03 fc 0e 2e  72 61 6e 67 65 64 6f 6e  |RTS.....rangedon|
00000ab0  65 0d 04 06 0b 43 4c 43  3a 52 54 53 0d 04 10 14  |e....CLC:RTS....|
00000ac0  5c 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |\***************|
00000ad0  0d 04 1a 14 5c 54 65 73  74 20 58 25 2c 59 25 20  |....\Test X%,Y% |
00000ae0  6f 6e 6c 79 0d 04 24 07  2e 54 25 0d 04 2e 0a 2e  |only..$..T%.....|
00000af0  74 65 73 74 4c 0d 04 38  3e 4c 44 41 78 68 69 3a  |testL..8>LDAxhi:|
00000b00  42 4d 49 6f 75 74 6f 66  72 61 6e 67 65 3a 5c 49  |BMIoutofrange:\I|
00000b10  66 20 58 25 20 69 73 20  2d 76 65 20 74 68 65 6e  |f X% is -ve then|
00000b20  20 69 74 20 69 73 20 6f  66 66 20 74 68 65 20 6c  | it is off the l|
00000b30  65 66 74 0d 04 42 0a 2e  74 65 73 74 52 0d 04 4c  |eft..B..testR..L|
00000b40  6e 4c 44 41 78 68 69 3a  43 4d 50 23 32 3a 42 4e  |nLDAxhi:CMP#2:BN|
00000b50  45 74 65 73 74 57 3a 4c  44 58 78 6c 6f 3a 43 50  |EtestW:LDXxlo:CP|
00000b60  58 23 26 38 30 3a 42 43  53 6f 75 74 6f 66 72 61  |X#&80:BCSoutofra|
00000b70  6e 67 65 3a 5c 49 66 20  58 25 3e 3d 26 32 38 30  |nge:\If X%>=&280|
00000b80  20 74 68 65 6e 20 69 74  20 69 73 20 6f 66 66 20  | then it is off |
00000b90  74 68 65 20 72 69 67 68  74 20 73 6f 20 73 65 74  |the right so set|
00000ba0  20 69 74 20 74 6f 20 26  32 37 46 0d 04 56 0a 2e  | it to &27F..V..|
00000bb0  74 65 73 74 57 0d 04 60  36 43 4d 50 23 33 3a 42  |testW..`6CMP#3:B|
00000bc0  43 53 6f 75 74 6f 66 72  61 6e 67 65 3a 5c 49 66  |CSoutofrange:\If|
00000bd0  20 58 25 3e 26 33 30 30  20 74 68 65 6e 20 69 74  | X%>&300 then it|
00000be0  27 73 20 77 65 6c 6c 20  6f 75 74 0d 04 6a 0a 2e  |'s well out..j..|
00000bf0  74 65 73 74 54 0d 04 74  18 4c 44 59 79 68 69 3a  |testT..t.LDYyhi:|
00000c00  42 4e 45 6f 75 74 6f 66  72 61 6e 67 65 0d 04 7e  |BNEoutofrange..~|
00000c10  0d 2e 74 65 73 74 64 6f  6e 65 0d 04 88 0b 43 4c  |..testdone....CL|
00000c20  43 3a 52 54 53 0d 04 92  0f 5c 2a 2a 2a 2a 2a 2a  |C:RTS....\******|
00000c30  2a 2a 2a 2a 0d 04 9c 14  5c 47 65 74 20 70 69 78  |****....\Get pix|
00000c40  65 6c 20 76 61 6c 75 65  0d 04 a6 07 2e 47 25 0d  |el value.....G%.|
00000c50  04 b0 27 53 45 43 3a 50  48 50 3a 42 43 53 6c 73  |..'SEC:PHP:BCSls|
00000c60  62 79 74 65 3a 5c 52 65  61 64 73 20 61 74 20 74  |byte:\Reads at t|
00000c70  68 65 20 65 6e 64 0d 04  ba 13 5c 2a 2a 2a 2a 2a  |he end....\*****|
00000c80  2a 2a 2a 2a 2a 2a 2a 2a  2a 0d 04 c4 24 5c 43 61  |*********...$\Ca|
00000c90  6c 63 75 6c 61 74 65 20  61 64 64 72 20 62 61 73  |lculate addr bas|
00000ca0  65 64 20 6f 6e 20 28 58  25 2c 59 25 29 0d 04 ce  |ed on (X%,Y%)...|
00000cb0  07 2e 43 25 0d 04 d8 1e  43 4c 43 3a 50 48 50 3a  |..C%....CLC:PHP:|
00000cc0  5c 57 72 69 74 65 73 20  61 74 20 74 68 65 20 65  |\Writes at the e|
00000cd0  6e 64 0d 04 e2 0b 2e 6c  73 62 79 74 65 0d 04 ec  |nd.....lsbyte...|
00000ce0  59 4c 44 41 79 6c 6f 3a  52 4f 52 41 3a 52 4f 52  |YLDAylo:RORA:ROR|
00000cf0  41 3a 80 23 28 33 32 2b  31 36 2b 38 2b 34 2b 32  |A:.#(32+16+8+4+2|
00000d00  29 3a 54 41 59 3a 5c 47  65 74 20 59 20 63 6f 2d  |):TAY:\Get Y co-|
00000d10  6f 72 64 69 6e 61 74 65  2c 64 69 76 69 64 65 20  |ordinate,divide |
00000d20  62 79 20 38 20 61 6e 64  20 6d 75 6c 74 69 70 6c  |by 8 and multipl|
00000d30  79 20 62 79 20 32 0d 04  f6 5a 4c 44 41 62 79 36  |y by 2...ZLDAby6|
00000d40  34 30 2c 59 3a 53 54 41  70 6f 69 6e 74 65 72 2b  |40,Y:STApointer+|
00000d50  32 3a 49 4e 59 3a 4c 44  41 62 79 36 34 30 2c 59  |2:INY:LDAby640,Y|
00000d60  3a 53 54 41 70 6f 69 6e  74 65 72 2b 31 3a 5c 47  |:STApointer+1:\G|
00000d70  65 74 20 2a 36 34 30 20  6f 66 66 73 65 74 20 66  |et *640 offset f|
00000d80  72 6f 6d 20 6c 6f 6f 6b  75 70 20 74 61 62 6c 65  |rom lookup table|
00000d90  0d 05 00 34 4c 44 41 79  6c 6f 3a 80 23 37 3a 84  |...4LDAylo:.#7:.|
00000da0  41 70 6f 69 6e 74 65 72  2b 31 3a 53 54 41 70 6f  |Apointer+1:STApo|
00000db0  69 6e 74 65 72 2b 31 3a  5c 41 64 64 20 6f 6e 20  |inter+1:\Add on |
00000dc0  59 20 83 37 0d 05 0a 50  4c 44 41 78 6c 6f 3a 80  |Y .7...PLDAxlo:.|
00000dd0  23 28 32 35 35 2d 37 29  3a 43 4c 43 3a 41 44 43  |#(255-7):CLC:ADC|
00000de0  70 6f 69 6e 74 65 72 2b  31 3a 53 54 41 70 6f 69  |pointer+1:STApoi|
00000df0  6e 74 65 72 2b 31 3a 53  54 41 73 61 76 65 69 74  |nter+1:STAsaveit|
00000e00  2b 31 3a 5c 53 61 76 65  20 69 6e 20 32 20 70 6c  |+1:\Save in 2 pl|
00000e10  61 63 65 73 0d 05 14 5a  42 43 43 6d 73 62 79 74  |aces...ZBCCmsbyt|
00000e20  65 3a 49 4e 43 70 6f 69  6e 74 65 72 2b 32 3a 5c  |e:INCpointer+2:\|
00000e30  41 64 64 20 6f 6e 20 69  6e 64 65 6e 74 20 66 72  |Add on indent fr|
00000e40  6f 6d 20 6c 65 66 74 20  6f 66 20 73 63 72 65 65  |om left of scree|
00000e50  6e 20 61 64 6a 75 73 74  69 6e 67 20 68 69 20 62  |n adjusting hi b|
00000e60  79 74 65 20 74 6f 6f 20  69 66 20 43 3d 31 0d 05  |yte too if C=1..|
00000e70  1e 0b 2e 6d 73 62 79 74  65 0d 05 28 83 4c 44 41  |...msbyte..(.LDA|
00000e80  78 68 69 3a 43 4c 43 3a  41 44 43 70 6f 69 6e 74  |xhi:CLC:ADCpoint|
00000e90  65 72 2b 32 3a 5c 48 61  73 20 74 6f 20 62 65 20  |er+2:\Has to be |
00000ea0  61 20 74 77 6f 20 62 79  74 65 20 61 64 64 69 74  |a two byte addit|
00000eb0  69 6f 6e 20 61 73 20 58  20 69 73 20 66 72 6f 6d  |ion as X is from|
00000ec0  20 30 20 74 6f 20 36 33  39 20 6e 6f 74 20 30 20  | 0 to 639 not 0 |
00000ed0  74 6f 20 32 35 35 20 28  68 65 6e 63 65 20 58 20  |to 255 (hence X |
00000ee0  77 69 6c 6c 20 6f 63 63  75 70 79 20 32 20 62 69  |will occupy 2 bi|
00000ef0  74 73 20 2b 20 38 20 62  69 74 73 29 0d 05 32 47  |ts + 8 bits)..2G|
00000f00  41 44 43 23 26 33 30 3a  53 54 41 70 6f 69 6e 74  |ADC#&30:STApoint|
00000f10  65 72 2b 32 3a 53 54 41  73 61 76 65 69 74 2b 32  |er+2:STAsaveit+2|
00000f20  3a 5c 41 64 64 20 6f 6e  20 26 33 30 30 30 20 61  |:\Add on &3000 a|
00000f30  6e 64 20 73 61 76 65 20  69 6e 20 32 20 70 6c 61  |nd save in 2 pla|
00000f40  63 65 73 0d 05 3c 18 5c  2a 2a 2a 2a 2a 2a 2a 2a  |ces..<.\********|
00000f50  2a 2a 2a 2a 2a 2a 2a 2a  2a 2a 2a 0d 05 46 2b 5c  |***********..F+\|
00000f60  53 65 65 20 77 68 61 74  20 70 6f 77 65 72 20 6f  |See what power o|
00000f70  66 20 32 20 69 73 20 61  73 6b 65 64 20 66 6f 72  |f 2 is asked for|
00000f80  20 62 79 20 58 25 0d 05  50 12 4c 44 41 78 6c 6f  | by X%..P.LDAxlo|
00000f90  3a 80 23 37 3a 54 41 59  0d 05 5a 0c 2e 70 6f 69  |:.#7:TAY..Z..poi|
00000fa0  6e 74 65 72 0d 05 64 1d  4c 44 41 26 39 39 39 39  |nter..d.LDA&9999|
00000fb0  3a 50 4c 50 3a 42 43 43  6c 6f 67 69 63 3a 52 54  |:PLP:BCClogic:RT|
00000fc0  53 0d 05 6e 0a 2e 6c 6f  67 69 63 0d 05 78 41 82  |S..n..logic..xA.|
00000fd0  70 77 72 74 77 6f 2c 59  3a 5c 4c 6f 67 69 63 20  |pwrtwo,Y:\Logic |
00000fe0  6f 70 65 72 61 74 69 6f  6e 20 64 65 66 69 6e 65  |operation define|
00000ff0  64 20 62 79 20 6f 70 63  6f 64 65 20 68 65 72 65  |d by opcode here|
00001000  20 28 64 65 66 61 75 6c  74 3d 82 29 0d 05 82 0b  | (default=.)....|
00001010  2e 73 61 76 65 69 74 0d  05 8c 2d 53 54 41 26 39  |.saveit...-STA&9|
00001020  39 39 39 3a 52 54 53 3a  5c 52 65 77 72 69 74 65  |999:RTS:\Rewrite|
00001030  20 6e 65 77 20 76 61 6c  75 65 20 74 6f 20 73 63  | new value to sc|
00001040  72 65 65 6e 0d 05 96 13  5c 2a 2a 2a 2a 2a 2a 2a  |reen....\*******|
00001050  2a 2a 2a 2a 2a 2a 2a 0d  05 a0 13 5c 53 77 61 70  |*******....\Swap|
00001060  20 76 61 72 69 61 62 6c  65 73 0d 05 aa 0c 2e 73  | variables.....s|
00001070  77 61 70 59 6e 51 0d 05  b4 47 4c 44 41 71 6c 6f  |wapYnQ...GLDAqlo|
00001080  3a 50 48 41 3a 4c 44 41  71 68 69 3a 4c 44 58 79  |:PHA:LDAqhi:LDXy|
00001090  6c 6f 3a 53 54 58 71 6c  6f 3a 4c 44 58 79 68 69  |lo:STXqlo:LDXyhi|
000010a0  3a 53 54 58 71 68 69 3a  53 54 41 79 68 69 3a 50  |:STXqhi:STAyhi:P|
000010b0  4c 41 3a 53 54 41 79 6c  6f 3a 52 54 53 0d 05 be  |LA:STAylo:RTS...|
000010c0  0c 2e 73 77 61 70 58 6e  50 0d 05 c8 47 4c 44 41  |..swapXnP...GLDA|
000010d0  70 6c 6f 3a 50 48 41 3a  4c 44 41 70 68 69 3a 4c  |plo:PHA:LDAphi:L|
000010e0  44 58 78 6c 6f 3a 53 54  58 70 6c 6f 3a 4c 44 58  |DXxlo:STXplo:LDX|
000010f0  78 68 69 3a 53 54 58 70  68 69 3a 53 54 41 78 68  |xhi:STXphi:STAxh|
00001100  69 3a 50 4c 41 3a 53 54  41 78 6c 6f 3a 52 54 53  |i:PLA:STAxlo:RTS|
00001110  0d 05 d2 10 5c 2a 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |....\***********|
00001120  0d 05 dc 10 5c 44 61 74  61 20 76 61 6c 75 65 73  |....\Data values|
00001130  0d 05 e6 0b 2e 70 77 72  74 77 6f 0d 05 f0 19 5c  |.....pwrtwo....\|
00001140  54 61 62 6c 65 20 6f 66  20 32 5e 6e 20 72 65 73  |Table of 2^n res|
00001150  75 6c 74 73 0d 05 fa 20  45 51 55 42 31 32 38 3a  |ults... EQUB128:|
00001160  45 51 55 42 36 34 3a 45  51 55 42 33 32 3a 45 51  |EQUB64:EQUB32:EQ|
00001170  55 42 31 36 0d 06 04 1b  45 51 55 42 38 3a 45 51  |UB16....EQUB8:EQ|
00001180  55 42 34 3a 45 51 55 42  32 3a 45 51 55 42 31 0d  |UB4:EQUB2:EQUB1.|
00001190  06 0e 0a 2e 62 79 36 34  30 0d 06 18 1a 5c 54 61  |....by640....\Ta|
000011a0  62 6c 65 20 6f 66 20 2a  36 34 30 20 72 65 73 75  |ble of *640 resu|
000011b0  6c 74 73 0d 06 22 1f 45  51 55 44 26 38 30 30 32  |lts..".EQUD&8002|
000011c0  30 30 30 30 3a 45 51 55  44 26 38 30 30 37 30 30  |0000:EQUD&800700|
000011d0  30 35 0d 06 2c 1f 45 51  55 44 26 38 30 30 43 30  |05..,.EQUD&800C0|
000011e0  30 30 41 3a 45 51 55 44  26 38 30 31 31 30 30 30  |00A:EQUD&8011000|
000011f0  46 0d 06 36 1f 45 51 55  44 26 38 30 31 36 30 30  |F..6.EQUD&801600|
00001200  31 34 3a 45 51 55 44 26  38 30 31 42 30 30 31 39  |14:EQUD&801B0019|
00001210  0d 06 40 1f 45 51 55 44  26 38 30 32 30 30 30 31  |..@.EQUD&8020001|
00001220  45 3a 45 51 55 44 26 38  30 32 35 30 30 32 33 0d  |E:EQUD&80250023.|
00001230  06 4a 1f 45 51 55 44 26  38 30 32 41 30 30 32 38  |.J.EQUD&802A0028|
00001240  3a 45 51 55 44 26 38 30  32 46 30 30 32 44 0d 06  |:EQUD&802F002D..|
00001250  54 1f 45 51 55 44 26 38  30 33 34 30 30 33 32 3a  |T.EQUD&80340032:|
00001260  45 51 55 44 26 38 30 33  39 30 30 33 37 0d 06 5e  |EQUD&80390037..^|
00001270  1f 45 51 55 44 26 38 30  33 45 30 30 33 43 3a 45  |.EQUD&803E003C:E|
00001280  51 55 44 26 38 30 34 33  30 30 34 31 0d 06 68 1f  |QUD&80430041..h.|
00001290  45 51 55 44 26 38 30 34  38 30 30 34 36 3a 45 51  |EQUD&80480046:EQ|
000012a0  55 44 26 38 30 34 44 30  30 34 42 0d 06 72 09 2e  |UD&804D004B..r..|
000012b0  72 65 73 4c 0d 06 7c 0e  5c 57 6f 72 6b 73 70 61  |resL..|.\Workspa|
000012c0  63 65 0d 06 86 07 42 52  4b 0d 06 90 09 2e 72 65  |ce....BRK.....re|
000012d0  73 48 0d 06 9a 0e 5c 57  6f 72 6b 73 70 61 63 65  |sH....\Workspace|
000012e0  0d 06 a4 07 42 52 4b 0d  06 ae 05 5d 0d 06 b8 05  |....BRK....]....|
000012f0  ed 0d 06 c2 05 e1 0d 06  cc 05 3a 0d 06 d6 0a dd  |..........:.....|
00001300  f2 6c 6f 61 64 0d 06 e0  79 ee 85 e7 9f 3e 31 32  |.load...y....>12|
00001310  37 20 8c f1 3a f1 22 46  69 6c 69 6e 67 20 73 79  |7 ..:."Filing sy|
00001320  73 74 65 6d 20 65 72 72  6f 72 22 3a 77 61 69 74  |stem error":wait|
00001330  25 3d a6 28 31 35 30 29  3a f9 20 8b f1 3a f1 22  |%=.(150):. ..:."|
00001340  55 6e 65 78 70 65 63 74  65 64 20 65 72 72 6f 72  |Unexpected error|
00001350  22 3a e0 3a f4 20 46 69  6c 69 6e 67 20 73 79 73  |":.:. Filing sys|
00001360  74 65 6d 20 65 72 72 6f  72 73 20 61 72 65 20 3e  |tem errors are >|
00001370  31 32 37 20 69 6e 20 67  65 6e 65 72 61 6c 0d 06  |127 in general..|
00001380  ea 37 f1 27 22 49 6e 73  65 72 74 20 73 6f 75 72  |.7.'"Insert sour|
00001390  63 65 20 6d 65 64 69 61  20 69 6e 74 6f 20 64 72  |ce media into dr|
000013a0  69 76 65 20 6e 6f 77 22  3a 77 61 69 74 25 3d a6  |ive now":wait%=.|
000013b0  28 35 30 30 29 0d 06 f4  1b f1 3a e8 22 45 6e 74  |(500).....:."Ent|
000013c0  65 72 20 66 69 6c 65 6e  61 6d 65 3a 20 22 46 24  |er filename: "F$|
000013d0  0d 06 fe 1a f4 20 54 72  79 20 74 6f 20 6f 70 65  |..... Try to ope|
000013e0  6e 20 74 68 65 20 66 69  6c 65 0d 07 08 18 65 78  |n the file....ex|
000013f0  69 73 74 25 3d 8e 20 46  24 3a d9 23 65 78 69 73  |ist%=. F$:.#exis|
00001400  74 25 0d 07 12 31 e7 65  78 69 73 74 25 3d a3 20  |t%...1.exist%=. |
00001410  8c f1 27 22 43 61 6e 27  74 20 66 69 6e 64 20 66  |..'"Can't find f|
00001420  69 6c 65 22 3a 77 61 69  74 25 3d a6 28 31 35 30  |ile":wait%=.(150|
00001430  29 3a f9 0d 07 1c 6d f1  27 22 4e 6f 77 20 6c 6f  |):....m.'"Now lo|
00001440  61 64 69 6e 67 2e 2e 2e  22 3b 46 24 3a 77 61 69  |ading...";F$:wai|
00001450  74 25 3d a6 28 31 35 30  29 3a ef 26 31 36 2c 30  |t%=.(150):.&16,0|
00001460  3a ff 28 22 4c 4f 41 44  20 22 2b 46 24 2b 22 20  |:.("LOAD "+F$+" |
00001470  33 30 30 30 22 29 3a f4  20 54 68 61 74 27 73 20  |3000"):. That's |
00001480  68 6f 77 20 74 6f 20 63  68 61 6e 67 65 20 4d 4f  |how to change MO|
00001490  44 45 20 69 6e 73 69 64  65 20 61 20 50 52 4f 43  |DE inside a PROC|
000014a0  0d 07 26 05 e1 0d 07 30  05 3a 0d 07 3a 09 dd f2  |..&....0.:..:...|
000014b0  6e 65 77 0d 07 44 28 f1  3a f1 22 43 72 65 61 74  |new..D(.:."Creat|
000014c0  69 6e 67 2e 2e 2e 22 3a  77 61 69 74 25 3d a6 28  |ing...":wait%=.(|
000014d0  31 35 30 29 3a ef 26 31  36 2c 30 0d 07 4e 05 e1  |150):.&16,0..N..|
000014e0  0d ff                                             |..|
000014e2
P/EDIT.m0
P/EDIT.m1
P/EDIT.m2
P/EDIT.m4
P/EDIT.m5