Home » CEEFAX disks » telesoftware12.adl » 17-02-89/SWtext
17-02-89/SWtext
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 » telesoftware12.adl |
Filename: | 17-02-89/SWtext |
Read OK: | ✔ |
File size: | 0FB0 bytes |
Load address: | 0800 |
Exec address: | 8023 |
File contents
10REM> SWTEXT 20DIM mcode &200 30xcoord=&70 40ycoord=&71 50fire=&72 60savereg=&FC 70start=&350 :REM: screen start address 80screen=&355 :REM: screen mode OS 1.2 90sheila=&FE00 100drb=&FE40 :REM: system 6522 input/output register B 110ifr=&FE4D :REM: system 6522 interrupt flag register 120ier=&FE4E :REM: system 6522 interrupt enable register 130FOR pass=4 TO 6 STEP 2 140O%=mcode 150P%=&8000 160[OPT pass 170BRK 180BRK 190BRK 200JMP service \ service entry to ROM 210EQUB &82 \ ROM type byte indicates a service entry 220EQUB copyright MOD 256 \ copyright offset pointer 230BRK \ BRK serves as binary version number 240EQUS"Light pen Text" \ title string 250.copyright 260BRK \ start of copyright/end of title 270EQUS "(C) Gordon Horsington 1987" 280BRK \ copyright terminator 290.exit 300PLA 310STA savereg 320LDA #&05 \ unrecognised interrupt service call 330.return 340RTS 350.service 360CMP #&05 \ is this an unrecognised interrupt? 370BNE return \ branch if not interrupt 380LDA savereg \ load interrupt accumulator save register 390PHA \ and push it on the stack 400LDA ifr \ load system VIA interrupt status 410BPL exit \ exit if bit 7 clear 420AND #&08 \ AND with %00001000 430BEQ exit \ exit if not light pen interrupt 440TXA 450PHA 460TYA 470PHA 480LDA drb \ clear interrupt 490PHA \ push data register B 500CLD \ clear decimal flag 510LDY screen \ screen mode into Y register 520LDA start \ screen start address, low byte 530STA ycoord 540LDA start+1 \ screen start address, high byte 550STA ycoord+1 560CPY #&07 \ is this mode 7? 570BEQ mode7 580LSR ycoord+1 590ROR ycoord \ start address DIV 2 600LSR ycoord+1 610ROR ycoord \ start address DIV 4 620LSR ycoord+1 630ROR ycoord \ start address DIV 8 640JMP continue \ skip mode 7 calculation 650.mode7 660SEC \ prepare for subtraction 670LDA ycoord+1 680SBC #&54 690STA ycoord+1 \ subtract &5400 from start address 700.continue 710LDA offsetlow,Y 720CLC \ prepare for addition 730ADC ycoord \ add trim to offset 740STA ycoord 750LDA #&00 760ADC ycoord+1 770STA ycoord+1 780SEC \ prepare to subtract offset from lp register 790LDX #&11 \ light pen register, low byte 800STX sheila \ 6845 address register 810LDA sheila+1 \ 6845 data register 820SBC ycoord \ subtract offset, low byte 830STA ycoord \ low byte - offset 840DEX \ X = &10, light pen register, high byte 850STX sheila \ 6845 address register 860LDA sheila+1 \ 6845 data register 870SBC ycoord+1 \ subtract offset, high byte 880STA ycoord+1 \ high byte - offset 890LDA #&00 \ prepare for 16 bit division 900STA xcoord \ clear low partial dividend 910.next 920ASL ycoord \ shift dividend/quotient left 930ROL ycoord+1 \ shift dividend/quotient left 940ROL xcoord \ shift bits into partial dividend 950LDA xcoord \ load partial dividend 960SEC \ prepare for subtraction 970SBC width,Y \ subtract divisor 980BCC done \ branch if dividend < divisor 990INC ycoord \ increment quotient 1000STA xcoord \ save new partial dividend 1010.done 1020DEX \ decrement bit counter 1030BNE next \ branch for 16 bits 1040LDA scale,Y \ screen mode scale 1050BEQ pullout \ branch if modes 0, 3, 4, 6 or 7 1060TAX \ in mode1 and mode5 X=1, in mode2 X=2 1070LDA xcoord 1080.reduce 1090LSR A \ horizontal position DIV 2 1100DEX 1110BNE reduce 1120STA xcoord 1130.pullout 1140PLA \ pull data register B 1150AND #&20 \ %00100000 1160STA fire \ store fire button status 1170PLA 1180TAY 1190PLA 1200TAX 1210PLA 1220STA savereg 1230LDA #&00 \ interrupt serviced 1240RTS \ return to operating system 1250.offsetlow 1260EQUB &04 \ mode0, untrimmed = &06 1270EQUB &04 \ mode1, untrimmed = &06 1280EQUB &04 \ mode2, untrimmed = &06 1290EQUB &04 \ mode3, untrimmed = &06 1300EQUB &03 \ mode4, untrimmed = &04 1310EQUB &03 \ mode5, untrimmed = &04 1320EQUB &03 \ mode6, untrimmed = &04 1330EQUB &06 \ mode7, untrimmed = &08 1340.scale 1350EQUD &00020100 \ modes 3-0 1360EQUD &00000100 \ modes 7-4 1370.width 1380EQUD &50505050 \ modes 3-0 1390EQUD &28282828 \ modes 7-4 1400.lastbyte 1410] 1420NEXT 1430*OPT1,2 1440OSCLI("SAVE LPTEXT "+STR$~(mcode)+" + "+STR$~(lastbyte-&8000)+" FFFF8000 FFFF8000") 1450*OPT0,0
�> SWTEXT � mcode &200 xcoord=&70 (ycoord=&71 2fire=&72 <savereg=&FC F'start=&350 :�: screen start address P&screen=&355 :�: screen mode OS 1.2 Zsheila=&FE00 d5drb=&FE40 :�: system 6522 input/output register B n5ifr=&FE4D :�: system 6522 interrupt flag register x7ier=&FE4E :�: system 6522 interrupt enable register �� pass=4 � 6 � 2 �O%=mcode �P%=&8000 � [OPT pass �BRK �BRK �BRK �&JMP service \ service entry to ROM �6EQUB &82 \ ROM type byte indicates a service entry �3EQUB copyright � 256 \ copyright offset pointer �.BRK \ BRK serves as binary version number �'EQUS"Light pen Text" \ title string �.copyright )BRK \ start of copyright/end of title %EQUS "(C) Gordon Horsington 1987" BRK \ copyright terminator " .exit ,PLA 6STA savereg @2LDA #&05 \ unrecognised interrupt service call J.return TRTS ^.service h1CMP #&05 \ is this an unrecognised interrupt? r(BNE return \ branch if not interrupt |:LDA savereg \ load interrupt accumulator save register �"PHA \ and push it on the stack �.LDA ifr \ load system VIA interrupt status �"BPL exit \ exit if bit 7 clear �� #&08 \ � with %00001000 �.BEQ exit \ exit if not light pen interrupt �TXA �PHA �TYA �PHA �LDA drb \ clear interrupt �PHA \ push data register B �CLD \ clear decimal flag �,LDY screen \ screen mode into Y register .LDA start \ screen start address, low byte STA ycoord 1LDA start+1 \ screen start address, high byte &STA ycoord+1 0CPY #&07 \ is this mode 7? : BEQ mode7 DLSR ycoord+1 N"ROR ycoord \ start address � 2 XLSR ycoord+1 b"ROR ycoord \ start address � 4 lLSR ycoord+1 v"ROR ycoord \ start address � 8 �*JMP continue \ skip mode 7 calculation � .mode7 �!SEC \ prepare for subtraction �LDA ycoord+1 �SBC #&54 �4STA ycoord+1 \ subtract &5400 from start address � .continue �LDA offsetlow,Y �CLC \ prepare for addition �#ADC ycoord \ add trim to offset �STA ycoord �LDA #&00 �ADC ycoord+1 STA ycoord+1 5SEC \ prepare to subtract offset from lp register +LDX #&11 \ light pen register, low byte &STX sheila \ 6845 address register *%LDA sheila+1 \ 6845 data register 4*SBC ycoord \ subtract offset, low byte >"STA ycoord \ low byte - offset H0DEX \ X = &10, light pen register, high byte R&STX sheila \ 6845 address register \%LDA sheila+1 \ 6845 data register f-SBC ycoord+1 \ subtract offset, high byte p%STA ycoord+1 \ high byte - offset z*LDA #&00 \ prepare for 16 bit division �+STA xcoord \ clear low partial dividend � .next �-ASL ycoord \ shift dividend/quotient left �/ROL ycoord+1 \ shift dividend/quotient left �1ROL xcoord \ shift bits into partial dividend �&LDA xcoord \ load partial dividend �!SEC \ prepare for subtraction �"SBC width,Y \ subtract divisor �+BCC done \ branch if dividend < divisor �#INC ycoord \ increment quotient �*STA xcoord \ save new partial dividend � .done �DEX \ decrement bit counter !BNE next \ branch for 16 bits #LDA scale,Y \ screen mode scale 1BEQ pullout \ branch if modes 0, 3, 4, 6 or 7 $.TAX \ in mode1 and mode5 X=1, in mode2 X=2 .LDA xcoord 8.reduce B#LSR A \ horizontal position � 2 LDEX VBNE reduce `STA xcoord j.pullout tPLA \ pull data register B ~� #&20 \ %00100000 �'STA fire \ store fire button status �PLA �TAY �PLA �TAX �PLA �STA savereg �!LDA #&00 \ interrupt serviced �$RTS \ return to operating system �.offsetlow �%EQUB &04 \ mode0, untrimmed = &06 �%EQUB &04 \ mode1, untrimmed = &06 %EQUB &04 \ mode2, untrimmed = &06 %EQUB &04 \ mode3, untrimmed = &06 %EQUB &03 \ mode4, untrimmed = &04 %EQUB &03 \ mode5, untrimmed = &04 (%EQUB &03 \ mode6, untrimmed = &04 2%EQUB &06 \ mode7, untrimmed = &08 < .scale FEQUD &00020100 \ modes 3-0 PEQUD &00000100 \ modes 7-4 Z .width dEQUD &50505050 \ modes 3-0 nEQUD &28282828 \ modes 7-4 x .lastbyte �] �� �*OPT1,2 �M�("SAVE LPTEXT "+�~(mcode)+" + "+�~(lastbyte-&8000)+" FFFF8000 FFFF8000") �*OPT0,0 �
00000000 0d 00 0a 0d f4 3e 20 53 57 54 45 58 54 0d 00 14 |.....> SWTEXT...| 00000010 10 de 20 6d 63 6f 64 65 20 26 32 30 30 0d 00 1e |.. mcode &200...| 00000020 0e 78 63 6f 6f 72 64 3d 26 37 30 0d 00 28 0e 79 |.xcoord=&70..(.y| 00000030 63 6f 6f 72 64 3d 26 37 31 0d 00 32 0c 66 69 72 |coord=&71..2.fir| 00000040 65 3d 26 37 32 0d 00 3c 0f 73 61 76 65 72 65 67 |e=&72..<.savereg| 00000050 3d 26 46 43 0d 00 46 27 73 74 61 72 74 3d 26 33 |=&FC..F'start=&3| 00000060 35 30 20 3a f4 3a 20 73 63 72 65 65 6e 20 73 74 |50 :.: screen st| 00000070 61 72 74 20 61 64 64 72 65 73 73 0d 00 50 26 73 |art address..P&s| 00000080 63 72 65 65 6e 3d 26 33 35 35 20 3a f4 3a 20 73 |creen=&355 :.: s| 00000090 63 72 65 65 6e 20 6d 6f 64 65 20 4f 53 20 31 2e |creen mode OS 1.| 000000a0 32 0d 00 5a 10 73 68 65 69 6c 61 3d 26 46 45 30 |2..Z.sheila=&FE0| 000000b0 30 0d 00 64 35 64 72 62 3d 26 46 45 34 30 20 3a |0..d5drb=&FE40 :| 000000c0 f4 3a 20 73 79 73 74 65 6d 20 36 35 32 32 20 69 |.: system 6522 i| 000000d0 6e 70 75 74 2f 6f 75 74 70 75 74 20 72 65 67 69 |nput/output regi| 000000e0 73 74 65 72 20 42 0d 00 6e 35 69 66 72 3d 26 46 |ster B..n5ifr=&F| 000000f0 45 34 44 20 3a f4 3a 20 73 79 73 74 65 6d 20 36 |E4D :.: system 6| 00000100 35 32 32 20 69 6e 74 65 72 72 75 70 74 20 66 6c |522 interrupt fl| 00000110 61 67 20 72 65 67 69 73 74 65 72 0d 00 78 37 69 |ag register..x7i| 00000120 65 72 3d 26 46 45 34 45 20 3a f4 3a 20 73 79 73 |er=&FE4E :.: sys| 00000130 74 65 6d 20 36 35 32 32 20 69 6e 74 65 72 72 75 |tem 6522 interru| 00000140 70 74 20 65 6e 61 62 6c 65 20 72 65 67 69 73 74 |pt enable regist| 00000150 65 72 0d 00 82 14 e3 20 70 61 73 73 3d 34 20 b8 |er..... pass=4 .| 00000160 20 36 20 88 20 32 0d 00 8c 0c 4f 25 3d 6d 63 6f | 6 . 2....O%=mco| 00000170 64 65 0d 00 96 0c 50 25 3d 26 38 30 30 30 0d 00 |de....P%=&8000..| 00000180 a0 0d 5b 4f 50 54 20 70 61 73 73 0d 00 aa 07 42 |..[OPT pass....B| 00000190 52 4b 0d 00 b4 07 42 52 4b 0d 00 be 07 42 52 4b |RK....BRK....BRK| 000001a0 0d 00 c8 26 4a 4d 50 20 73 65 72 76 69 63 65 20 |...&JMP service | 000001b0 5c 20 73 65 72 76 69 63 65 20 65 6e 74 72 79 20 |\ service entry | 000001c0 74 6f 20 52 4f 4d 0d 00 d2 36 45 51 55 42 20 26 |to ROM...6EQUB &| 000001d0 38 32 20 5c 20 52 4f 4d 20 74 79 70 65 20 62 79 |82 \ ROM type by| 000001e0 74 65 20 69 6e 64 69 63 61 74 65 73 20 61 20 73 |te indicates a s| 000001f0 65 72 76 69 63 65 20 65 6e 74 72 79 0d 00 dc 33 |ervice entry...3| 00000200 45 51 55 42 20 63 6f 70 79 72 69 67 68 74 20 83 |EQUB copyright .| 00000210 20 32 35 36 20 5c 20 63 6f 70 79 72 69 67 68 74 | 256 \ copyright| 00000220 20 6f 66 66 73 65 74 20 70 6f 69 6e 74 65 72 0d | offset pointer.| 00000230 00 e6 2e 42 52 4b 20 20 5c 20 42 52 4b 20 73 65 |...BRK \ BRK se| 00000240 72 76 65 73 20 61 73 20 62 69 6e 61 72 79 20 76 |rves as binary v| 00000250 65 72 73 69 6f 6e 20 6e 75 6d 62 65 72 0d 00 f0 |ersion number...| 00000260 27 45 51 55 53 22 4c 69 67 68 74 20 70 65 6e 20 |'EQUS"Light pen | 00000270 54 65 78 74 22 20 5c 20 74 69 74 6c 65 20 73 74 |Text" \ title st| 00000280 72 69 6e 67 0d 00 fa 0e 2e 63 6f 70 79 72 69 67 |ring.....copyrig| 00000290 68 74 0d 01 04 29 42 52 4b 20 5c 20 73 74 61 72 |ht...)BRK \ star| 000002a0 74 20 6f 66 20 63 6f 70 79 72 69 67 68 74 2f 65 |t of copyright/e| 000002b0 6e 64 20 6f 66 20 74 69 74 6c 65 0d 01 0e 25 45 |nd of title...%E| 000002c0 51 55 53 20 22 28 43 29 20 47 6f 72 64 6f 6e 20 |QUS "(C) Gordon | 000002d0 48 6f 72 73 69 6e 67 74 6f 6e 20 31 39 38 37 22 |Horsington 1987"| 000002e0 0d 01 18 1e 42 52 4b 20 5c 20 63 6f 70 79 72 69 |....BRK \ copyri| 000002f0 67 68 74 20 74 65 72 6d 69 6e 61 74 6f 72 0d 01 |ght terminator..| 00000300 22 09 2e 65 78 69 74 0d 01 2c 07 50 4c 41 0d 01 |"..exit..,.PLA..| 00000310 36 0f 53 54 41 20 73 61 76 65 72 65 67 0d 01 40 |6.STA savereg..@| 00000320 32 4c 44 41 20 23 26 30 35 20 5c 20 75 6e 72 65 |2LDA #&05 \ unre| 00000330 63 6f 67 6e 69 73 65 64 20 69 6e 74 65 72 72 75 |cognised interru| 00000340 70 74 20 73 65 72 76 69 63 65 20 63 61 6c 6c 0d |pt service call.| 00000350 01 4a 0b 2e 72 65 74 75 72 6e 0d 01 54 07 52 54 |.J..return..T.RT| 00000360 53 0d 01 5e 0c 2e 73 65 72 76 69 63 65 0d 01 68 |S..^..service..h| 00000370 31 43 4d 50 20 23 26 30 35 20 5c 20 69 73 20 74 |1CMP #&05 \ is t| 00000380 68 69 73 20 61 6e 20 75 6e 72 65 63 6f 67 6e 69 |his an unrecogni| 00000390 73 65 64 20 69 6e 74 65 72 72 75 70 74 3f 0d 01 |sed interrupt?..| 000003a0 72 28 42 4e 45 20 72 65 74 75 72 6e 20 5c 20 62 |r(BNE return \ b| 000003b0 72 61 6e 63 68 20 69 66 20 6e 6f 74 20 69 6e 74 |ranch if not int| 000003c0 65 72 72 75 70 74 0d 01 7c 3a 4c 44 41 20 73 61 |errupt..|:LDA sa| 000003d0 76 65 72 65 67 20 5c 20 6c 6f 61 64 20 69 6e 74 |vereg \ load int| 000003e0 65 72 72 75 70 74 20 61 63 63 75 6d 75 6c 61 74 |errupt accumulat| 000003f0 6f 72 20 73 61 76 65 20 72 65 67 69 73 74 65 72 |or save register| 00000400 0d 01 86 22 50 48 41 20 5c 20 61 6e 64 20 70 75 |..."PHA \ and pu| 00000410 73 68 20 69 74 20 6f 6e 20 74 68 65 20 73 74 61 |sh it on the sta| 00000420 63 6b 0d 01 90 2e 4c 44 41 20 69 66 72 20 5c 20 |ck....LDA ifr \ | 00000430 6c 6f 61 64 20 73 79 73 74 65 6d 20 56 49 41 20 |load system VIA | 00000440 69 6e 74 65 72 72 75 70 74 20 73 74 61 74 75 73 |interrupt status| 00000450 0d 01 9a 22 42 50 4c 20 65 78 69 74 20 5c 20 65 |..."BPL exit \ e| 00000460 78 69 74 20 69 66 20 62 69 74 20 37 20 63 6c 65 |xit if bit 7 cle| 00000470 61 72 0d 01 a4 1d 80 20 23 26 30 38 20 5c 20 80 |ar..... #&08 \ .| 00000480 20 77 69 74 68 20 25 30 30 30 30 31 30 30 30 0d | with %00001000.| 00000490 01 ae 2e 42 45 51 20 65 78 69 74 20 5c 20 65 78 |...BEQ exit \ ex| 000004a0 69 74 20 69 66 20 6e 6f 74 20 6c 69 67 68 74 20 |it if not light | 000004b0 70 65 6e 20 69 6e 74 65 72 72 75 70 74 0d 01 b8 |pen interrupt...| 000004c0 07 54 58 41 0d 01 c2 07 50 48 41 0d 01 cc 07 54 |.TXA....PHA....T| 000004d0 59 41 0d 01 d6 07 50 48 41 0d 01 e0 1d 4c 44 41 |YA....PHA....LDA| 000004e0 20 64 72 62 20 5c 20 63 6c 65 61 72 20 69 6e 74 | drb \ clear int| 000004f0 65 72 72 75 70 74 0d 01 ea 1e 50 48 41 20 5c 20 |errupt....PHA \ | 00000500 70 75 73 68 20 64 61 74 61 20 72 65 67 69 73 74 |push data regist| 00000510 65 72 20 42 0d 01 f4 1c 43 4c 44 20 5c 20 63 6c |er B....CLD \ cl| 00000520 65 61 72 20 64 65 63 69 6d 61 6c 20 66 6c 61 67 |ear decimal flag| 00000530 0d 01 fe 2c 4c 44 59 20 73 63 72 65 65 6e 20 5c |...,LDY screen \| 00000540 20 73 63 72 65 65 6e 20 6d 6f 64 65 20 69 6e 74 | screen mode int| 00000550 6f 20 59 20 72 65 67 69 73 74 65 72 0d 02 08 2e |o Y register....| 00000560 4c 44 41 20 73 74 61 72 74 20 5c 20 73 63 72 65 |LDA start \ scre| 00000570 65 6e 20 73 74 61 72 74 20 61 64 64 72 65 73 73 |en start address| 00000580 2c 20 6c 6f 77 20 62 79 74 65 0d 02 12 0e 53 54 |, low byte....ST| 00000590 41 20 79 63 6f 6f 72 64 0d 02 1c 31 4c 44 41 20 |A ycoord...1LDA | 000005a0 73 74 61 72 74 2b 31 20 5c 20 73 63 72 65 65 6e |start+1 \ screen| 000005b0 20 73 74 61 72 74 20 61 64 64 72 65 73 73 2c 20 | start address, | 000005c0 68 69 67 68 20 62 79 74 65 0d 02 26 10 53 54 41 |high byte..&.STA| 000005d0 20 79 63 6f 6f 72 64 2b 31 0d 02 30 1e 43 50 59 | ycoord+1..0.CPY| 000005e0 20 23 26 30 37 20 5c 20 69 73 20 74 68 69 73 20 | #&07 \ is this | 000005f0 6d 6f 64 65 20 37 3f 0d 02 3a 0d 42 45 51 20 6d |mode 7?..:.BEQ m| 00000600 6f 64 65 37 0d 02 44 10 4c 53 52 20 79 63 6f 6f |ode7..D.LSR ycoo| 00000610 72 64 2b 31 0d 02 4e 22 52 4f 52 20 79 63 6f 6f |rd+1..N"ROR ycoo| 00000620 72 64 20 5c 20 73 74 61 72 74 20 61 64 64 72 65 |rd \ start addre| 00000630 73 73 20 81 20 32 0d 02 58 10 4c 53 52 20 79 63 |ss . 2..X.LSR yc| 00000640 6f 6f 72 64 2b 31 0d 02 62 22 52 4f 52 20 79 63 |oord+1..b"ROR yc| 00000650 6f 6f 72 64 20 5c 20 73 74 61 72 74 20 61 64 64 |oord \ start add| 00000660 72 65 73 73 20 81 20 34 0d 02 6c 10 4c 53 52 20 |ress . 4..l.LSR | 00000670 79 63 6f 6f 72 64 2b 31 0d 02 76 22 52 4f 52 20 |ycoord+1..v"ROR | 00000680 79 63 6f 6f 72 64 20 5c 20 73 74 61 72 74 20 61 |ycoord \ start a| 00000690 64 64 72 65 73 73 20 81 20 38 0d 02 80 2a 4a 4d |ddress . 8...*JM| 000006a0 50 20 63 6f 6e 74 69 6e 75 65 20 5c 20 73 6b 69 |P continue \ ski| 000006b0 70 20 6d 6f 64 65 20 37 20 63 61 6c 63 75 6c 61 |p mode 7 calcula| 000006c0 74 69 6f 6e 0d 02 8a 0a 2e 6d 6f 64 65 37 0d 02 |tion.....mode7..| 000006d0 94 21 53 45 43 20 5c 20 70 72 65 70 61 72 65 20 |.!SEC \ prepare | 000006e0 66 6f 72 20 73 75 62 74 72 61 63 74 69 6f 6e 0d |for subtraction.| 000006f0 02 9e 10 4c 44 41 20 79 63 6f 6f 72 64 2b 31 0d |...LDA ycoord+1.| 00000700 02 a8 0c 53 42 43 20 23 26 35 34 0d 02 b2 34 53 |...SBC #&54...4S| 00000710 54 41 20 79 63 6f 6f 72 64 2b 31 20 5c 20 73 75 |TA ycoord+1 \ su| 00000720 62 74 72 61 63 74 20 26 35 34 30 30 20 66 72 6f |btract &5400 fro| 00000730 6d 20 73 74 61 72 74 20 61 64 64 72 65 73 73 0d |m start address.| 00000740 02 bc 0d 2e 63 6f 6e 74 69 6e 75 65 0d 02 c6 13 |....continue....| 00000750 4c 44 41 20 6f 66 66 73 65 74 6c 6f 77 2c 59 0d |LDA offsetlow,Y.| 00000760 02 d0 1e 43 4c 43 20 5c 20 70 72 65 70 61 72 65 |...CLC \ prepare| 00000770 20 66 6f 72 20 61 64 64 69 74 69 6f 6e 0d 02 da | for addition...| 00000780 23 41 44 43 20 79 63 6f 6f 72 64 20 5c 20 61 64 |#ADC ycoord \ ad| 00000790 64 20 74 72 69 6d 20 74 6f 20 6f 66 66 73 65 74 |d trim to offset| 000007a0 0d 02 e4 0e 53 54 41 20 79 63 6f 6f 72 64 0d 02 |....STA ycoord..| 000007b0 ee 0c 4c 44 41 20 23 26 30 30 0d 02 f8 10 41 44 |..LDA #&00....AD| 000007c0 43 20 79 63 6f 6f 72 64 2b 31 0d 03 02 10 53 54 |C ycoord+1....ST| 000007d0 41 20 79 63 6f 6f 72 64 2b 31 0d 03 0c 35 53 45 |A ycoord+1...5SE| 000007e0 43 20 5c 20 70 72 65 70 61 72 65 20 74 6f 20 73 |C \ prepare to s| 000007f0 75 62 74 72 61 63 74 20 6f 66 66 73 65 74 20 66 |ubtract offset f| 00000800 72 6f 6d 20 6c 70 20 72 65 67 69 73 74 65 72 0d |rom lp register.| 00000810 03 16 2b 4c 44 58 20 23 26 31 31 20 5c 20 6c 69 |..+LDX #&11 \ li| 00000820 67 68 74 20 70 65 6e 20 72 65 67 69 73 74 65 72 |ght pen register| 00000830 2c 20 6c 6f 77 20 62 79 74 65 0d 03 20 26 53 54 |, low byte.. &ST| 00000840 58 20 73 68 65 69 6c 61 20 5c 20 36 38 34 35 20 |X sheila \ 6845 | 00000850 61 64 64 72 65 73 73 20 72 65 67 69 73 74 65 72 |address register| 00000860 0d 03 2a 25 4c 44 41 20 73 68 65 69 6c 61 2b 31 |..*%LDA sheila+1| 00000870 20 5c 20 36 38 34 35 20 64 61 74 61 20 72 65 67 | \ 6845 data reg| 00000880 69 73 74 65 72 0d 03 34 2a 53 42 43 20 79 63 6f |ister..4*SBC yco| 00000890 6f 72 64 20 5c 20 73 75 62 74 72 61 63 74 20 6f |ord \ subtract o| 000008a0 66 66 73 65 74 2c 20 6c 6f 77 20 62 79 74 65 0d |ffset, low byte.| 000008b0 03 3e 22 53 54 41 20 79 63 6f 6f 72 64 20 5c 20 |.>"STA ycoord \ | 000008c0 6c 6f 77 20 62 79 74 65 20 2d 20 6f 66 66 73 65 |low byte - offse| 000008d0 74 0d 03 48 30 44 45 58 20 5c 20 58 20 3d 20 26 |t..H0DEX \ X = &| 000008e0 31 30 2c 20 6c 69 67 68 74 20 70 65 6e 20 72 65 |10, light pen re| 000008f0 67 69 73 74 65 72 2c 20 68 69 67 68 20 62 79 74 |gister, high byt| 00000900 65 0d 03 52 26 53 54 58 20 73 68 65 69 6c 61 20 |e..R&STX sheila | 00000910 5c 20 36 38 34 35 20 61 64 64 72 65 73 73 20 72 |\ 6845 address r| 00000920 65 67 69 73 74 65 72 0d 03 5c 25 4c 44 41 20 73 |egister..\%LDA s| 00000930 68 65 69 6c 61 2b 31 20 5c 20 36 38 34 35 20 64 |heila+1 \ 6845 d| 00000940 61 74 61 20 72 65 67 69 73 74 65 72 0d 03 66 2d |ata register..f-| 00000950 53 42 43 20 79 63 6f 6f 72 64 2b 31 20 5c 20 73 |SBC ycoord+1 \ s| 00000960 75 62 74 72 61 63 74 20 6f 66 66 73 65 74 2c 20 |ubtract offset, | 00000970 68 69 67 68 20 62 79 74 65 0d 03 70 25 53 54 41 |high byte..p%STA| 00000980 20 79 63 6f 6f 72 64 2b 31 20 5c 20 68 69 67 68 | ycoord+1 \ high| 00000990 20 62 79 74 65 20 2d 20 6f 66 66 73 65 74 0d 03 | byte - offset..| 000009a0 7a 2a 4c 44 41 20 23 26 30 30 20 5c 20 70 72 65 |z*LDA #&00 \ pre| 000009b0 70 61 72 65 20 66 6f 72 20 31 36 20 62 69 74 20 |pare for 16 bit | 000009c0 64 69 76 69 73 69 6f 6e 0d 03 84 2b 53 54 41 20 |division...+STA | 000009d0 78 63 6f 6f 72 64 20 5c 20 63 6c 65 61 72 20 6c |xcoord \ clear l| 000009e0 6f 77 20 70 61 72 74 69 61 6c 20 64 69 76 69 64 |ow partial divid| 000009f0 65 6e 64 0d 03 8e 09 2e 6e 65 78 74 0d 03 98 2d |end.....next...-| 00000a00 41 53 4c 20 79 63 6f 6f 72 64 20 5c 20 73 68 69 |ASL ycoord \ shi| 00000a10 66 74 20 64 69 76 69 64 65 6e 64 2f 71 75 6f 74 |ft dividend/quot| 00000a20 69 65 6e 74 20 6c 65 66 74 0d 03 a2 2f 52 4f 4c |ient left.../ROL| 00000a30 20 79 63 6f 6f 72 64 2b 31 20 5c 20 73 68 69 66 | ycoord+1 \ shif| 00000a40 74 20 64 69 76 69 64 65 6e 64 2f 71 75 6f 74 69 |t dividend/quoti| 00000a50 65 6e 74 20 6c 65 66 74 0d 03 ac 31 52 4f 4c 20 |ent left...1ROL | 00000a60 78 63 6f 6f 72 64 20 5c 20 73 68 69 66 74 20 62 |xcoord \ shift b| 00000a70 69 74 73 20 69 6e 74 6f 20 70 61 72 74 69 61 6c |its into partial| 00000a80 20 64 69 76 69 64 65 6e 64 0d 03 b6 26 4c 44 41 | dividend...&LDA| 00000a90 20 78 63 6f 6f 72 64 20 5c 20 6c 6f 61 64 20 70 | xcoord \ load p| 00000aa0 61 72 74 69 61 6c 20 64 69 76 69 64 65 6e 64 0d |artial dividend.| 00000ab0 03 c0 21 53 45 43 20 5c 20 70 72 65 70 61 72 65 |..!SEC \ prepare| 00000ac0 20 66 6f 72 20 73 75 62 74 72 61 63 74 69 6f 6e | for subtraction| 00000ad0 0d 03 ca 22 53 42 43 20 77 69 64 74 68 2c 59 20 |..."SBC width,Y | 00000ae0 5c 20 73 75 62 74 72 61 63 74 20 64 69 76 69 73 |\ subtract divis| 00000af0 6f 72 0d 03 d4 2b 42 43 43 20 64 6f 6e 65 20 5c |or...+BCC done \| 00000b00 20 62 72 61 6e 63 68 20 69 66 20 64 69 76 69 64 | branch if divid| 00000b10 65 6e 64 20 3c 20 64 69 76 69 73 6f 72 0d 03 de |end < divisor...| 00000b20 23 49 4e 43 20 79 63 6f 6f 72 64 20 5c 20 69 6e |#INC ycoord \ in| 00000b30 63 72 65 6d 65 6e 74 20 71 75 6f 74 69 65 6e 74 |crement quotient| 00000b40 0d 03 e8 2a 53 54 41 20 78 63 6f 6f 72 64 20 5c |...*STA xcoord \| 00000b50 20 73 61 76 65 20 6e 65 77 20 70 61 72 74 69 61 | save new partia| 00000b60 6c 20 64 69 76 69 64 65 6e 64 0d 03 f2 09 2e 64 |l dividend.....d| 00000b70 6f 6e 65 0d 03 fc 1f 44 45 58 20 5c 20 64 65 63 |one....DEX \ dec| 00000b80 72 65 6d 65 6e 74 20 62 69 74 20 63 6f 75 6e 74 |rement bit count| 00000b90 65 72 0d 04 06 21 42 4e 45 20 6e 65 78 74 20 5c |er...!BNE next \| 00000ba0 20 62 72 61 6e 63 68 20 66 6f 72 20 31 36 20 62 | branch for 16 b| 00000bb0 69 74 73 0d 04 10 23 4c 44 41 20 73 63 61 6c 65 |its...#LDA scale| 00000bc0 2c 59 20 5c 20 73 63 72 65 65 6e 20 6d 6f 64 65 |,Y \ screen mode| 00000bd0 20 73 63 61 6c 65 0d 04 1a 31 42 45 51 20 70 75 | scale...1BEQ pu| 00000be0 6c 6c 6f 75 74 20 5c 20 62 72 61 6e 63 68 20 69 |llout \ branch i| 00000bf0 66 20 6d 6f 64 65 73 20 30 2c 20 33 2c 20 34 2c |f modes 0, 3, 4,| 00000c00 20 36 20 6f 72 20 37 0d 04 24 2e 54 41 58 20 5c | 6 or 7..$.TAX \| 00000c10 20 69 6e 20 6d 6f 64 65 31 20 61 6e 64 20 6d 6f | in mode1 and mo| 00000c20 64 65 35 20 58 3d 31 2c 20 69 6e 20 6d 6f 64 65 |de5 X=1, in mode| 00000c30 32 20 58 3d 32 0d 04 2e 0e 4c 44 41 20 78 63 6f |2 X=2....LDA xco| 00000c40 6f 72 64 0d 04 38 0b 2e 72 65 64 75 63 65 0d 04 |ord..8..reduce..| 00000c50 42 23 4c 53 52 20 41 20 5c 20 68 6f 72 69 7a 6f |B#LSR A \ horizo| 00000c60 6e 74 61 6c 20 70 6f 73 69 74 69 6f 6e 20 81 20 |ntal position . | 00000c70 32 0d 04 4c 07 44 45 58 0d 04 56 0e 42 4e 45 20 |2..L.DEX..V.BNE | 00000c80 72 65 64 75 63 65 0d 04 60 0e 53 54 41 20 78 63 |reduce..`.STA xc| 00000c90 6f 6f 72 64 0d 04 6a 0c 2e 70 75 6c 6c 6f 75 74 |oord..j..pullout| 00000ca0 0d 04 74 1e 50 4c 41 20 5c 20 70 75 6c 6c 20 64 |..t.PLA \ pull d| 00000cb0 61 74 61 20 72 65 67 69 73 74 65 72 20 42 0d 04 |ata register B..| 00000cc0 7e 16 80 20 23 26 32 30 20 5c 20 25 30 30 31 30 |~.. #&20 \ %0010| 00000cd0 30 30 30 30 0d 04 88 27 53 54 41 20 66 69 72 65 |0000...'STA fire| 00000ce0 20 5c 20 73 74 6f 72 65 20 66 69 72 65 20 62 75 | \ store fire bu| 00000cf0 74 74 6f 6e 20 73 74 61 74 75 73 0d 04 92 07 50 |tton status....P| 00000d00 4c 41 0d 04 9c 07 54 41 59 0d 04 a6 07 50 4c 41 |LA....TAY....PLA| 00000d10 0d 04 b0 07 54 41 58 0d 04 ba 07 50 4c 41 0d 04 |....TAX....PLA..| 00000d20 c4 0f 53 54 41 20 73 61 76 65 72 65 67 0d 04 ce |..STA savereg...| 00000d30 21 4c 44 41 20 23 26 30 30 20 5c 20 69 6e 74 65 |!LDA #&00 \ inte| 00000d40 72 72 75 70 74 20 73 65 72 76 69 63 65 64 0d 04 |rrupt serviced..| 00000d50 d8 24 52 54 53 20 5c 20 72 65 74 75 72 6e 20 74 |.$RTS \ return t| 00000d60 6f 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 |o operating syst| 00000d70 65 6d 0d 04 e2 0e 2e 6f 66 66 73 65 74 6c 6f 77 |em.....offsetlow| 00000d80 0d 04 ec 25 45 51 55 42 20 26 30 34 20 5c 20 6d |...%EQUB &04 \ m| 00000d90 6f 64 65 30 2c 20 75 6e 74 72 69 6d 6d 65 64 20 |ode0, untrimmed | 00000da0 3d 20 26 30 36 0d 04 f6 25 45 51 55 42 20 26 30 |= &06...%EQUB &0| 00000db0 34 20 5c 20 6d 6f 64 65 31 2c 20 75 6e 74 72 69 |4 \ mode1, untri| 00000dc0 6d 6d 65 64 20 3d 20 26 30 36 0d 05 00 25 45 51 |mmed = &06...%EQ| 00000dd0 55 42 20 26 30 34 20 5c 20 6d 6f 64 65 32 2c 20 |UB &04 \ mode2, | 00000de0 75 6e 74 72 69 6d 6d 65 64 20 3d 20 26 30 36 0d |untrimmed = &06.| 00000df0 05 0a 25 45 51 55 42 20 26 30 34 20 5c 20 6d 6f |..%EQUB &04 \ mo| 00000e00 64 65 33 2c 20 75 6e 74 72 69 6d 6d 65 64 20 3d |de3, untrimmed =| 00000e10 20 26 30 36 0d 05 14 25 45 51 55 42 20 26 30 33 | &06...%EQUB &03| 00000e20 20 5c 20 6d 6f 64 65 34 2c 20 75 6e 74 72 69 6d | \ mode4, untrim| 00000e30 6d 65 64 20 3d 20 26 30 34 0d 05 1e 25 45 51 55 |med = &04...%EQU| 00000e40 42 20 26 30 33 20 5c 20 6d 6f 64 65 35 2c 20 75 |B &03 \ mode5, u| 00000e50 6e 74 72 69 6d 6d 65 64 20 3d 20 26 30 34 0d 05 |ntrimmed = &04..| 00000e60 28 25 45 51 55 42 20 26 30 33 20 5c 20 6d 6f 64 |(%EQUB &03 \ mod| 00000e70 65 36 2c 20 75 6e 74 72 69 6d 6d 65 64 20 3d 20 |e6, untrimmed = | 00000e80 26 30 34 0d 05 32 25 45 51 55 42 20 26 30 36 20 |&04..2%EQUB &06 | 00000e90 5c 20 6d 6f 64 65 37 2c 20 75 6e 74 72 69 6d 6d |\ mode7, untrimm| 00000ea0 65 64 20 3d 20 26 30 38 0d 05 3c 0a 2e 73 63 61 |ed = &08..<..sca| 00000eb0 6c 65 0d 05 46 1e 45 51 55 44 20 26 30 30 30 32 |le..F.EQUD &0002| 00000ec0 30 31 30 30 20 5c 20 6d 6f 64 65 73 20 33 2d 30 |0100 \ modes 3-0| 00000ed0 0d 05 50 1e 45 51 55 44 20 26 30 30 30 30 30 31 |..P.EQUD &000001| 00000ee0 30 30 20 5c 20 6d 6f 64 65 73 20 37 2d 34 0d 05 |00 \ modes 7-4..| 00000ef0 5a 0a 2e 77 69 64 74 68 0d 05 64 1e 45 51 55 44 |Z..width..d.EQUD| 00000f00 20 26 35 30 35 30 35 30 35 30 20 5c 20 6d 6f 64 | &50505050 \ mod| 00000f10 65 73 20 33 2d 30 0d 05 6e 1e 45 51 55 44 20 26 |es 3-0..n.EQUD &| 00000f20 32 38 32 38 32 38 32 38 20 5c 20 6d 6f 64 65 73 |28282828 \ modes| 00000f30 20 37 2d 34 0d 05 78 0d 2e 6c 61 73 74 62 79 74 | 7-4..x..lastbyt| 00000f40 65 0d 05 82 05 5d 0d 05 8c 05 ed 0d 05 96 0b 2a |e....].........*| 00000f50 4f 50 54 31 2c 32 0d 05 a0 4d ff 28 22 53 41 56 |OPT1,2...M.("SAV| 00000f60 45 20 4c 50 54 45 58 54 20 22 2b c3 7e 28 6d 63 |E LPTEXT "+.~(mc| 00000f70 6f 64 65 29 2b 22 20 2b 20 22 2b c3 7e 28 6c 61 |ode)+" + "+.~(la| 00000f80 73 74 62 79 74 65 2d 26 38 30 30 30 29 2b 22 20 |stbyte-&8000)+" | 00000f90 46 46 46 46 38 30 30 30 20 46 46 46 46 38 30 30 |FFFF8000 FFFF800| 00000fa0 30 22 29 0d 05 aa 0b 2a 4f 50 54 30 2c 30 0d ff |0")....*OPT0,0..| 00000fb0