Home » Personal collection » Acorn hard disk » misc » misc2 » biobot/BioBot/6502/AIAss

biobot/BioBot/6502/AIAss

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 hard disk » misc » misc2
Filename: biobot/BioBot/6502/AIAss
Read OK:
File size: 12E7 bytes
Load address: 0000
Exec address: 0000
Duplicates

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

File contents
   10 REM Assemble BallBot AI
   20 REM Module (C) Dominic Ford 1997/8
   30 :
   40 REM Setup variables / allocate zero-page bytes
   50 MODE6:HIMEM=&3000:oswrch=&FFEE:osbyte=&FFF4
   60 idle=&81:near=&82:searching=&83:left=&84:right=&85:steer=&86:tending=&87
   70 reving=&88:stage=&89:turbo=&8A:reverse=&8B
   80 freqa=&70:freqb=&71:freqc=&72:freqd=&73:fa=&74:fb=&75:fc=&76:fd=&77
   90 :
  100 REM Start assembly
  110 FORpass=0 TO 3 STEP 3
  120 :
  130 REM Packaging for module
  140 P%=&3000:[OPT pass
  150 LDA#&8C:JSRosbyte \ Select tape to make ADFS free
  160 LDY#0:.text LDAwelcome,Y:CMP#&FF:BEQunzip
  170 JSRoswrch:INY:JMPtext \ Hello World!!
  180 .unzip LDA#(start MOD 256):STA&78:LDA#(start DIV 256):STA&79:LDY#0:STY&7A:LDA#&E:STA&7B:.movlop LDA(&78),Y:STA(&7A),Y:INY:BNEmovlop:INC&79:INC&7B:LDA&7B:CMP#&18:BNEmovlop:JMP&E00 \ Invade ADFS memory
  190 .welcome EQUB 17:EQUB 0:EQUB 17:EQUB 129
  200 EQUS "BallBot AI module 6502 version          "
  210 EQUS "Original   - Dominic Ford Sept-Dec 1997 "
  220 EQUS "Conversion - Dominic Ford Jan 1998      "
  230 EQUB 17:EQUB 1:EQUB 17:EQUB 128:EQUB &FF:.start
  240 ]
  250 :
  260 REM 6502 Artificial Intelligence module for BallBot
  270 :
  280 O%=P%:P%=&E00:[OPT (pass+4)
  290 JMPsetupbb:JMPai \ Entry points
  300 .setupbb LDA#0:STAreving:STAleft:STAright:STAsearching:STAnear:STAsteer:STAstage:STAidle:LDA#1:STAtending:RTS
  310 .ai LDA#0:STAleft:STAright:STAturbo:STAreverse
  320 LDAnear:CMP#0:BEQnotnear:LDAstage:CMP#4:BCSnotnear:JSRdonearstuff
  330 .notnear LDAnear:BNEnotmov:LDAstage:CMP#1:BEQnothunt:CMP#3:BCSnothunt:JSRhunt
  340 .nothunt LDAstage:CMP#4:BCSnotmov:AND#1:BEQnotmov:JSRmoveout
  350 .notmov LDAstage:CMP#4:BNEnotrelease:JSRreleaseb
  360 .notrelease LDA#0:STA&80:LDAleft:AND#1:CLC:ADC&80:STA&80:LDAright:AND#2:CLC:ADC&80:STA&80:LDAturbo:AND#4:CLC:ADC&80:STA&80:LDAidle:AND#8:CLC:ADC&80:STA&80:LDAreverse:AND#16:CLC:ADC&80:STA&80:RTS
  370 .hunt LDAfreqa:CMP#8:BCSnothr1:LDAfa:CMP#ASC"B":BEQnothr1:JMPrevershnt
  380 .nothr1 LDAfreqb:CMP#4:BCSnothr2:LDAfb:CMP#ASC"B":BEQnothr2:JMPrevershnt
  390 .nothr2 LDAfreqc:CMP#4:BCSnothr3:LDAfc:CMP#ASC"B":BEQnothr3
  400 .revershnt LDA#5:STAreving:LDA#&FF:STAreverse:STAturbo:STAleft:STAright:RTS
  410 .nothr3 LDAreving:BEQnothrev:LDAfreqa:CMP#38:BCCconthrev:LDAfreqb:CMP#38:BCCconthrev:LDAfreqc:CMP#38:BCSnothrev
  420 .conthrev DECreving:LDA#&FF:STAturbo:STAleft:STAright:STAreverse:RTS
  430 .nothrev LDA#0:STAreving
  440 \ Rotate to face ball (L310)
  450 LDAfb:CMP#ASC"B":BNEnottendl:LDAfreqb:CMP#38:BCCnottendl:LDA#0:STAtending
  460 .nottendl LDAfc:CMP#ASC"B":BNEnottendr:LDAfreqc:CMP#38:BCCnottendr:LDA#1:STAtending:.nottendr
  470 \Pick best ball to aim at
  480 LDAfreqa:LSR A:LSR A:STA&80:ASL A:CLC:ADC&80:PHA:CMPfreqb:BCCnothnl:LDAfb:CMP#ASC"B":BNEnothnl:LDAfc:CMP#ASC"B":BNEhnl:LDAfreqb:CMPfreqc:BCSnothnl:.hnl LDA#&FF:STAleft:STAsteer:PLA:RTS
  490 .nothnl PLA:CMPfreqc:BCCnothnr:LDAfc:CMP#ASC"B":BNEnothnr:LDAfb:CMP#ASC"B":BNEhnr:LDAfreqc:CMPfreqb:BCSnothnr:.hnr LDA#&FF:STAright:LDA#1:STAsteer:RTS
  500 .nothnr LDAfa:CMP#ASC"B":BNEl370:LDX#0:LDAsteer:CMP#1:BEQnofaadd:LDX#&FF:.nofaadd STXleft:LDX#0:CMP#&FF:BEQnofaadd2:LDX#&FF:.nofaadd2 STXright
  510 LDA#0:STAsteer:LDAsearching:LSR A:STAsearching:LDX#0:LDAfreqa:CMP#25:BCCnofaadd3:LDX#&FF:.nofaadd3 STX turbo:RTS
  520 .l370 LDAfb:CMP#ASC"B":BNEl380:LDA#&FF:STAsteer:STAleft:RTS
  530 .l380 LDAfc:CMP#ASC"B":BNEl390:LDA#1:STAsteer:LDA#&FF:STAright:RTS:.l390
  540 \ If no ball in sight, continue rotation
  550 INCsearching:LDA#0:STAsteer:STAturbo:STAsteer:LDAsearching:CMP#6:BCCnotturrot:LDA#&FF:STAturbo:.notturrot LDX#&FF:LDAtending:BEQtend0:STXright:JMPl430:.tend0 STXleft
  560 .l430 LDAsearching:CMP#5:BNEl440:LDAtending:EOR#1:STAtending
  570 .l440 LDAsearching:CMP#50:BCCl450:INCstage:.l450 RTS
  580 RTS
  590 :
  600 .moveout LDAfreqa:CMP#8:BCCmovonet:LDAfreqb:CMP#8:BCCmovonet:LDAfreqc:CMP#8:BCCmovonet:LDAreving:BEQl510:LDAfreqa:CMP#19:BCCmovonet:LDAfreqb:CMP#19:BCCmovonet:LDAfreqc:CMP#19:BCSl510
  610 .movonet LDA#&FF:STAreving:STAreverse:STAleft:STAright:RTS
  620 .l510 LDA#0:STAreving:LDAfa:CMP#ASC"B":BEQgoget:LDAfb:CMP#ASC"B":BEQgoget:LDAfc:CMP#ASC"B":BEQgoget:LDAfd:CMP#ASC"B":BNEl540:.goget DECstage:LDA#44:STAsearching:RTS
  630 .l540 LDAfa:CMP#ASC"N":BEQmovorig:CMP#ASC"P":BNEl560:.movorig LDA#&FF:STAright:RTS
  640 .l560 LDAfb:CMP#ASC"N":BEQl580:CMP#ASC"P":BEQl570:LDA#&FF:STAleft:RTS
  650 .l570 LDAfreqb:CMP#38:BCSl580:LDA#&FF:STAright:LDA#1:STAnear:RTS
  660 .l580 LDA#&FF:STAturbo:STAleft:STAright:RTS
  670 .donearstuff LDAfreqa:CMP#8:BCSl640:LDAfa:CMP#ASC"B":BEQl640:LDA#&FF:STAright:RTS
  680 .l640 LDAnear:CMP#1:BNEl650:LDAfd:CMP#ASC"U":BEQl650:LDA#&FF:STAleft:STAright:RTS
  690 .l650 INCnear:LDA#&FF:STAleft:STAturbo:LDAnear:AND#1:BEQnearl:LDA#&FF:.nearl STAright
  700 LDAnear:CMP#18:BCCnearend:LDA#0:STAnear:STAsearching:INCstage:LDA#1:STAtending:.nearend RTS
  710 .releaseb LDA#&FF:STAleft:STAright:STAreverse:STAturbo:INCnear:LDAnear:CMP#10:BCCnearend:LDA#0:STAnear:LDA#&FF:STAidle:RTS
  720 ]:NEXT
  730 OSCLI "SAVE AI 3000 "+STR$~O%

 � Assemble BallBot AI
% � Module (C) Dominic Ford 1997/8
 :
(1 � Setup variables / allocate zero-page bytes
2) �6:�=&3000:oswrch=&FFEE:osbyte=&FFF4
<M idle=&81:near=&82:searching=&83:left=&84:right=&85:steer=&86:tending=&87
F/ reving=&88:stage=&89:turbo=&8A:reverse=&8B
PH freqa=&70:freqb=&71:freqc=&72:freqd=&73:fa=&74:fb=&75:fc=&76:fd=&77
Z :
d � Start assembly
n �pass=0 � 3 � 3
x :
� � Packaging for module
� P%=&3000:[OPT pass
�6 LDA#&8C:JSRosbyte \ Select tape to make ADFS free
�. LDY#0:.text LDAwelcome,Y:CMP#&FF:BEQunzip
�* JSRoswrch:INY:JMPtext \ Hello World!!
�� .unzip LDA#(start � 256):STA&78:LDA#(start � 256):STA&79:LDY#0:STY&7A:LDA#&E:STA&7B:.movlop LDA(&78),Y:STA(&7A),Y:INY:BNEmovlop:INC&79:INC&7B:LDA&7B:CMP#&18:BNEmovlop:JMP&E00 \ Invade ADFS memory
�- .welcome EQUB 17:EQUB 0:EQUB 17:EQUB 129
�4 EQUS "BallBot AI module 6502 version          "
�4 EQUS "Original   - Dominic Ford Sept-Dec 1997 "
�4 EQUS "Conversion - Dominic Ford Jan 1998      "
�4 EQUB 17:EQUB 1:EQUB 17:EQUB 128:EQUB &FF:.start
� ]
� :
6 � 6502 Artificial Intelligence module for BallBot
 :
  O%=P%:P%=&E00:[OPT (pass+4)
"$ JMPsetupbb:JMPai \ Entry points
,r .setupbb LDA#0:STAreving:STAleft:STAright:STAsearching:STAnear:STAsteer:STAstage:STAidle:LDA#1:STAtending:RTS
63 .ai LDA#0:STAleft:STAright:STAturbo:STAreverse
@F LDAnear:CMP#0:BEQnotnear:LDAstage:CMP#4:BCSnotnear:JSRdonearstuff
JR .notnear LDAnear:BNEnotmov:LDAstage:CMP#1:BEQnothunt:CMP#3:BCSnothunt:JSRhunt
T? .nothunt LDAstage:CMP#4:BCSnotmov:�#1:BEQnotmov:JSRmoveout
^5 .notmov LDAstage:CMP#4:BNEnotrelease:JSRreleaseb
h� .notrelease LDA#0:STA&80:LDAleft:�#1:CLC:ADC&80:STA&80:LDAright:�#2:CLC:ADC&80:STA&80:LDAturbo:�#4:CLC:ADC&80:STA&80:LDAidle:�#8:CLC:ADC&80:STA&80:LDAreverse:�#16:CLC:ADC&80:STA&80:RTS
rI .hunt LDAfreqa:CMP#8:BCSnothr1:LDAfa:CMP#�"B":BEQnothr1:JMPrevershnt
|K .nothr1 LDAfreqb:CMP#4:BCSnothr2:LDAfb:CMP#�"B":BEQnothr2:JMPrevershnt
�> .nothr2 LDAfreqc:CMP#4:BCSnothr3:LDAfc:CMP#�"B":BEQnothr3
�P .revershnt LDA#5:STAreving:LDA#&FF:STAreverse:STAturbo:STAleft:STAright:RTS
�t .nothr3 LDAreving:BEQnothrev:LDAfreqa:CMP#38:BCCconthrev:LDAfreqb:CMP#38:BCCconthrev:LDAfreqc:CMP#38:BCSnothrev
�I .conthrev DECreving:LDA#&FF:STAturbo:STAleft:STAright:STAreverse:RTS
� .nothrev LDA#0:STAreving
�! \ Rotate to face ball (L310)
�L LDAfb:CMP#�"B":BNEnottendl:LDAfreqb:CMP#38:BCCnottendl:LDA#0:STAtending
�` .nottendl LDAfc:CMP#�"B":BNEnottendr:LDAfreqc:CMP#38:BCCnottendr:LDA#1:STAtending:.nottendr
� \Pick best ball to aim at
� LDAfreqa:LSR A:LSR A:STA&80:ASL A:CLC:ADC&80:PHA:CMPfreqb:BCCnothnl:LDAfb:CMP#�"B":BNEnothnl:LDAfc:CMP#�"B":BNEhnl:LDAfreqb:CMPfreqc:BCSnothnl:.hnl LDA#&FF:STAleft:STAsteer:PLA:RTS
� .nothnl PLA:CMPfreqc:BCCnothnr:LDAfc:CMP#�"B":BNEnothnr:LDAfb:CMP#�"B":BNEhnr:LDAfreqc:CMPfreqb:BCSnothnr:.hnr LDA#&FF:STAright:LDA#1:STAsteer:RTS
� .nothnr LDAfa:CMP#�"B":BNEl370:LDX#0:LDAsteer:CMP#1:BEQnofaadd:LDX#&FF:.nofaadd STXleft:LDX#0:CMP#&FF:BEQnofaadd2:LDX#&FF:.nofaadd2 STXright
�u LDA#0:STAsteer:LDAsearching:LSR A:STAsearching:LDX#0:LDAfreqa:CMP#25:BCCnofaadd3:LDX#&FF:.nofaadd3 STX turbo:RTS
> .l370 LDAfb:CMP#�"B":BNEl380:LDA#&FF:STAsteer:STAleft:RTS
K .l380 LDAfc:CMP#�"B":BNEl390:LDA#1:STAsteer:LDA#&FF:STAright:RTS:.l390
- \ If no ball in sight, continue rotation
&� INCsearching:LDA#0:STAsteer:STAturbo:STAsteer:LDAsearching:CMP#6:BCCnotturrot:LDA#&FF:STAturbo:.notturrot LDX#&FF:LDAtending:BEQtend0:STXright:JMPl430:.tend0 STXleft
0? .l430 LDAsearching:CMP#5:BNEl440:LDAtending:�#1:STAtending
:9 .l440 LDAsearching:CMP#50:BCCl450:INCstage:.l450 RTS
D RTS
N :
X� .moveout LDAfreqa:CMP#8:BCCmovonet:LDAfreqb:CMP#8:BCCmovonet:LDAfreqc:CMP#8:BCCmovonet:LDAreving:BEQl510:LDAfreqa:CMP#19:BCCmovonet:LDAfreqb:CMP#19:BCCmovonet:LDAfreqc:CMP#19:BCSl510
b? .movonet LDA#&FF:STAreving:STAreverse:STAleft:STAright:RTS
l� .l510 LDA#0:STAreving:LDAfa:CMP#�"B":BEQgoget:LDAfb:CMP#�"B":BEQgoget:LDAfc:CMP#�"B":BEQgoget:LDAfd:CMP#�"B":BNEl540:.goget DECstage:LDA#44:STAsearching:RTS
vS .l540 LDAfa:CMP#�"N":BEQmovorig:CMP#�"P":BNEl560:.movorig LDA#&FF:STAright:RTS
�F .l560 LDAfb:CMP#�"N":BEQl580:CMP#�"P":BEQl570:LDA#&FF:STAleft:RTS
�E .l570 LDAfreqb:CMP#38:BCSl580:LDA#&FF:STAright:LDA#1:STAnear:RTS
�0 .l580 LDA#&FF:STAturbo:STAleft:STAright:RTS
�T .donearstuff LDAfreqa:CMP#8:BCSl640:LDAfa:CMP#�"B":BEQl640:LDA#&FF:STAright:RTS
�T .l640 LDAnear:CMP#1:BNEl650:LDAfd:CMP#�"U":BEQl650:LDA#&FF:STAleft:STAright:RTS
�X .l650 INCnear:LDA#&FF:STAleft:STAturbo:LDAnear:�#1:BEQnearl:LDA#&FF:.nearl STAright
�` LDAnear:CMP#18:BCCnearend:LDA#0:STAnear:STAsearching:INCstage:LDA#1:STAtending:.nearend RTS
� .releaseb LDA#&FF:STAleft:STAright:STAreverse:STAturbo:INCnear:LDAnear:CMP#10:BCCnearend:LDA#0:STAnear:LDA#&FF:STAidle:RTS
� ]:�
� � "SAVE AI 3000 "+�~O%
�
00000000  0d 00 0a 1a 20 f4 20 41  73 73 65 6d 62 6c 65 20  |.... . Assemble |
00000010  42 61 6c 6c 42 6f 74 20  41 49 0d 00 14 25 20 f4  |BallBot AI...% .|
00000020  20 4d 6f 64 75 6c 65 20  28 43 29 20 44 6f 6d 69  | Module (C) Domi|
00000030  6e 69 63 20 46 6f 72 64  20 31 39 39 37 2f 38 0d  |nic Ford 1997/8.|
00000040  00 1e 06 20 3a 0d 00 28  31 20 f4 20 53 65 74 75  |... :..(1 . Setu|
00000050  70 20 76 61 72 69 61 62  6c 65 73 20 2f 20 61 6c  |p variables / al|
00000060  6c 6f 63 61 74 65 20 7a  65 72 6f 2d 70 61 67 65  |locate zero-page|
00000070  20 62 79 74 65 73 0d 00  32 29 20 eb 36 3a d3 3d  | bytes..2) .6:.=|
00000080  26 33 30 30 30 3a 6f 73  77 72 63 68 3d 26 46 46  |&3000:oswrch=&FF|
00000090  45 45 3a 6f 73 62 79 74  65 3d 26 46 46 46 34 0d  |EE:osbyte=&FFF4.|
000000a0  00 3c 4d 20 69 64 6c 65  3d 26 38 31 3a 6e 65 61  |.<M idle=&81:nea|
000000b0  72 3d 26 38 32 3a 73 65  61 72 63 68 69 6e 67 3d  |r=&82:searching=|
000000c0  26 38 33 3a 6c 65 66 74  3d 26 38 34 3a 72 69 67  |&83:left=&84:rig|
000000d0  68 74 3d 26 38 35 3a 73  74 65 65 72 3d 26 38 36  |ht=&85:steer=&86|
000000e0  3a 74 65 6e 64 69 6e 67  3d 26 38 37 0d 00 46 2f  |:tending=&87..F/|
000000f0  20 72 65 76 69 6e 67 3d  26 38 38 3a 73 74 61 67  | reving=&88:stag|
00000100  65 3d 26 38 39 3a 74 75  72 62 6f 3d 26 38 41 3a  |e=&89:turbo=&8A:|
00000110  72 65 76 65 72 73 65 3d  26 38 42 0d 00 50 48 20  |reverse=&8B..PH |
00000120  66 72 65 71 61 3d 26 37  30 3a 66 72 65 71 62 3d  |freqa=&70:freqb=|
00000130  26 37 31 3a 66 72 65 71  63 3d 26 37 32 3a 66 72  |&71:freqc=&72:fr|
00000140  65 71 64 3d 26 37 33 3a  66 61 3d 26 37 34 3a 66  |eqd=&73:fa=&74:f|
00000150  62 3d 26 37 35 3a 66 63  3d 26 37 36 3a 66 64 3d  |b=&75:fc=&76:fd=|
00000160  26 37 37 0d 00 5a 06 20  3a 0d 00 64 15 20 f4 20  |&77..Z. :..d. . |
00000170  53 74 61 72 74 20 61 73  73 65 6d 62 6c 79 0d 00  |Start assembly..|
00000180  6e 14 20 e3 70 61 73 73  3d 30 20 b8 20 33 20 88  |n. .pass=0 . 3 .|
00000190  20 33 0d 00 78 06 20 3a  0d 00 82 1b 20 f4 20 50  | 3..x. :.... . P|
000001a0  61 63 6b 61 67 69 6e 67  20 66 6f 72 20 6d 6f 64  |ackaging for mod|
000001b0  75 6c 65 0d 00 8c 17 20  50 25 3d 26 33 30 30 30  |ule.... P%=&3000|
000001c0  3a 5b 4f 50 54 20 70 61  73 73 0d 00 96 36 20 4c  |:[OPT pass...6 L|
000001d0  44 41 23 26 38 43 3a 4a  53 52 6f 73 62 79 74 65  |DA#&8C:JSRosbyte|
000001e0  20 5c 20 53 65 6c 65 63  74 20 74 61 70 65 20 74  | \ Select tape t|
000001f0  6f 20 6d 61 6b 65 20 41  44 46 53 20 66 72 65 65  |o make ADFS free|
00000200  0d 00 a0 2e 20 4c 44 59  23 30 3a 2e 74 65 78 74  |.... LDY#0:.text|
00000210  20 4c 44 41 77 65 6c 63  6f 6d 65 2c 59 3a 43 4d  | LDAwelcome,Y:CM|
00000220  50 23 26 46 46 3a 42 45  51 75 6e 7a 69 70 0d 00  |P#&FF:BEQunzip..|
00000230  aa 2a 20 4a 53 52 6f 73  77 72 63 68 3a 49 4e 59  |.* JSRoswrch:INY|
00000240  3a 4a 4d 50 74 65 78 74  20 5c 20 48 65 6c 6c 6f  |:JMPtext \ Hello|
00000250  20 57 6f 72 6c 64 21 21  0d 00 b4 c8 20 2e 75 6e  | World!!.... .un|
00000260  7a 69 70 20 4c 44 41 23  28 73 74 61 72 74 20 83  |zip LDA#(start .|
00000270  20 32 35 36 29 3a 53 54  41 26 37 38 3a 4c 44 41  | 256):STA&78:LDA|
00000280  23 28 73 74 61 72 74 20  81 20 32 35 36 29 3a 53  |#(start . 256):S|
00000290  54 41 26 37 39 3a 4c 44  59 23 30 3a 53 54 59 26  |TA&79:LDY#0:STY&|
000002a0  37 41 3a 4c 44 41 23 26  45 3a 53 54 41 26 37 42  |7A:LDA#&E:STA&7B|
000002b0  3a 2e 6d 6f 76 6c 6f 70  20 4c 44 41 28 26 37 38  |:.movlop LDA(&78|
000002c0  29 2c 59 3a 53 54 41 28  26 37 41 29 2c 59 3a 49  |),Y:STA(&7A),Y:I|
000002d0  4e 59 3a 42 4e 45 6d 6f  76 6c 6f 70 3a 49 4e 43  |NY:BNEmovlop:INC|
000002e0  26 37 39 3a 49 4e 43 26  37 42 3a 4c 44 41 26 37  |&79:INC&7B:LDA&7|
000002f0  42 3a 43 4d 50 23 26 31  38 3a 42 4e 45 6d 6f 76  |B:CMP#&18:BNEmov|
00000300  6c 6f 70 3a 4a 4d 50 26  45 30 30 20 5c 20 49 6e  |lop:JMP&E00 \ In|
00000310  76 61 64 65 20 41 44 46  53 20 6d 65 6d 6f 72 79  |vade ADFS memory|
00000320  0d 00 be 2d 20 2e 77 65  6c 63 6f 6d 65 20 45 51  |...- .welcome EQ|
00000330  55 42 20 31 37 3a 45 51  55 42 20 30 3a 45 51 55  |UB 17:EQUB 0:EQU|
00000340  42 20 31 37 3a 45 51 55  42 20 31 32 39 0d 00 c8  |B 17:EQUB 129...|
00000350  34 20 45 51 55 53 20 22  42 61 6c 6c 42 6f 74 20  |4 EQUS "BallBot |
00000360  41 49 20 6d 6f 64 75 6c  65 20 36 35 30 32 20 76  |AI module 6502 v|
00000370  65 72 73 69 6f 6e 20 20  20 20 20 20 20 20 20 20  |ersion          |
00000380  22 0d 00 d2 34 20 45 51  55 53 20 22 4f 72 69 67  |"...4 EQUS "Orig|
00000390  69 6e 61 6c 20 20 20 2d  20 44 6f 6d 69 6e 69 63  |inal   - Dominic|
000003a0  20 46 6f 72 64 20 53 65  70 74 2d 44 65 63 20 31  | Ford Sept-Dec 1|
000003b0  39 39 37 20 22 0d 00 dc  34 20 45 51 55 53 20 22  |997 "...4 EQUS "|
000003c0  43 6f 6e 76 65 72 73 69  6f 6e 20 2d 20 44 6f 6d  |Conversion - Dom|
000003d0  69 6e 69 63 20 46 6f 72  64 20 4a 61 6e 20 31 39  |inic Ford Jan 19|
000003e0  39 38 20 20 20 20 20 20  22 0d 00 e6 34 20 45 51  |98      "...4 EQ|
000003f0  55 42 20 31 37 3a 45 51  55 42 20 31 3a 45 51 55  |UB 17:EQUB 1:EQU|
00000400  42 20 31 37 3a 45 51 55  42 20 31 32 38 3a 45 51  |B 17:EQUB 128:EQ|
00000410  55 42 20 26 46 46 3a 2e  73 74 61 72 74 0d 00 f0  |UB &FF:.start...|
00000420  06 20 5d 0d 00 fa 06 20  3a 0d 01 04 36 20 f4 20  |. ].... :...6 . |
00000430  36 35 30 32 20 41 72 74  69 66 69 63 69 61 6c 20  |6502 Artificial |
00000440  49 6e 74 65 6c 6c 69 67  65 6e 63 65 20 6d 6f 64  |Intelligence mod|
00000450  75 6c 65 20 66 6f 72 20  42 61 6c 6c 42 6f 74 0d  |ule for BallBot.|
00000460  01 0e 06 20 3a 0d 01 18  20 20 4f 25 3d 50 25 3a  |... :...  O%=P%:|
00000470  50 25 3d 26 45 30 30 3a  5b 4f 50 54 20 28 70 61  |P%=&E00:[OPT (pa|
00000480  73 73 2b 34 29 0d 01 22  24 20 4a 4d 50 73 65 74  |ss+4).."$ JMPset|
00000490  75 70 62 62 3a 4a 4d 50  61 69 20 5c 20 45 6e 74  |upbb:JMPai \ Ent|
000004a0  72 79 20 70 6f 69 6e 74  73 0d 01 2c 72 20 2e 73  |ry points..,r .s|
000004b0  65 74 75 70 62 62 20 4c  44 41 23 30 3a 53 54 41  |etupbb LDA#0:STA|
000004c0  72 65 76 69 6e 67 3a 53  54 41 6c 65 66 74 3a 53  |reving:STAleft:S|
000004d0  54 41 72 69 67 68 74 3a  53 54 41 73 65 61 72 63  |TAright:STAsearc|
000004e0  68 69 6e 67 3a 53 54 41  6e 65 61 72 3a 53 54 41  |hing:STAnear:STA|
000004f0  73 74 65 65 72 3a 53 54  41 73 74 61 67 65 3a 53  |steer:STAstage:S|
00000500  54 41 69 64 6c 65 3a 4c  44 41 23 31 3a 53 54 41  |TAidle:LDA#1:STA|
00000510  74 65 6e 64 69 6e 67 3a  52 54 53 0d 01 36 33 20  |tending:RTS..63 |
00000520  2e 61 69 20 4c 44 41 23  30 3a 53 54 41 6c 65 66  |.ai LDA#0:STAlef|
00000530  74 3a 53 54 41 72 69 67  68 74 3a 53 54 41 74 75  |t:STAright:STAtu|
00000540  72 62 6f 3a 53 54 41 72  65 76 65 72 73 65 0d 01  |rbo:STAreverse..|
00000550  40 46 20 4c 44 41 6e 65  61 72 3a 43 4d 50 23 30  |@F LDAnear:CMP#0|
00000560  3a 42 45 51 6e 6f 74 6e  65 61 72 3a 4c 44 41 73  |:BEQnotnear:LDAs|
00000570  74 61 67 65 3a 43 4d 50  23 34 3a 42 43 53 6e 6f  |tage:CMP#4:BCSno|
00000580  74 6e 65 61 72 3a 4a 53  52 64 6f 6e 65 61 72 73  |tnear:JSRdonears|
00000590  74 75 66 66 0d 01 4a 52  20 2e 6e 6f 74 6e 65 61  |tuff..JR .notnea|
000005a0  72 20 4c 44 41 6e 65 61  72 3a 42 4e 45 6e 6f 74  |r LDAnear:BNEnot|
000005b0  6d 6f 76 3a 4c 44 41 73  74 61 67 65 3a 43 4d 50  |mov:LDAstage:CMP|
000005c0  23 31 3a 42 45 51 6e 6f  74 68 75 6e 74 3a 43 4d  |#1:BEQnothunt:CM|
000005d0  50 23 33 3a 42 43 53 6e  6f 74 68 75 6e 74 3a 4a  |P#3:BCSnothunt:J|
000005e0  53 52 68 75 6e 74 0d 01  54 3f 20 2e 6e 6f 74 68  |SRhunt..T? .noth|
000005f0  75 6e 74 20 4c 44 41 73  74 61 67 65 3a 43 4d 50  |unt LDAstage:CMP|
00000600  23 34 3a 42 43 53 6e 6f  74 6d 6f 76 3a 80 23 31  |#4:BCSnotmov:.#1|
00000610  3a 42 45 51 6e 6f 74 6d  6f 76 3a 4a 53 52 6d 6f  |:BEQnotmov:JSRmo|
00000620  76 65 6f 75 74 0d 01 5e  35 20 2e 6e 6f 74 6d 6f  |veout..^5 .notmo|
00000630  76 20 4c 44 41 73 74 61  67 65 3a 43 4d 50 23 34  |v LDAstage:CMP#4|
00000640  3a 42 4e 45 6e 6f 74 72  65 6c 65 61 73 65 3a 4a  |:BNEnotrelease:J|
00000650  53 52 72 65 6c 65 61 73  65 62 0d 01 68 bd 20 2e  |SRreleaseb..h. .|
00000660  6e 6f 74 72 65 6c 65 61  73 65 20 4c 44 41 23 30  |notrelease LDA#0|
00000670  3a 53 54 41 26 38 30 3a  4c 44 41 6c 65 66 74 3a  |:STA&80:LDAleft:|
00000680  80 23 31 3a 43 4c 43 3a  41 44 43 26 38 30 3a 53  |.#1:CLC:ADC&80:S|
00000690  54 41 26 38 30 3a 4c 44  41 72 69 67 68 74 3a 80  |TA&80:LDAright:.|
000006a0  23 32 3a 43 4c 43 3a 41  44 43 26 38 30 3a 53 54  |#2:CLC:ADC&80:ST|
000006b0  41 26 38 30 3a 4c 44 41  74 75 72 62 6f 3a 80 23  |A&80:LDAturbo:.#|
000006c0  34 3a 43 4c 43 3a 41 44  43 26 38 30 3a 53 54 41  |4:CLC:ADC&80:STA|
000006d0  26 38 30 3a 4c 44 41 69  64 6c 65 3a 80 23 38 3a  |&80:LDAidle:.#8:|
000006e0  43 4c 43 3a 41 44 43 26  38 30 3a 53 54 41 26 38  |CLC:ADC&80:STA&8|
000006f0  30 3a 4c 44 41 72 65 76  65 72 73 65 3a 80 23 31  |0:LDAreverse:.#1|
00000700  36 3a 43 4c 43 3a 41 44  43 26 38 30 3a 53 54 41  |6:CLC:ADC&80:STA|
00000710  26 38 30 3a 52 54 53 0d  01 72 49 20 2e 68 75 6e  |&80:RTS..rI .hun|
00000720  74 20 4c 44 41 66 72 65  71 61 3a 43 4d 50 23 38  |t LDAfreqa:CMP#8|
00000730  3a 42 43 53 6e 6f 74 68  72 31 3a 4c 44 41 66 61  |:BCSnothr1:LDAfa|
00000740  3a 43 4d 50 23 97 22 42  22 3a 42 45 51 6e 6f 74  |:CMP#."B":BEQnot|
00000750  68 72 31 3a 4a 4d 50 72  65 76 65 72 73 68 6e 74  |hr1:JMPrevershnt|
00000760  0d 01 7c 4b 20 2e 6e 6f  74 68 72 31 20 4c 44 41  |..|K .nothr1 LDA|
00000770  66 72 65 71 62 3a 43 4d  50 23 34 3a 42 43 53 6e  |freqb:CMP#4:BCSn|
00000780  6f 74 68 72 32 3a 4c 44  41 66 62 3a 43 4d 50 23  |othr2:LDAfb:CMP#|
00000790  97 22 42 22 3a 42 45 51  6e 6f 74 68 72 32 3a 4a  |."B":BEQnothr2:J|
000007a0  4d 50 72 65 76 65 72 73  68 6e 74 0d 01 86 3e 20  |MPrevershnt...> |
000007b0  2e 6e 6f 74 68 72 32 20  4c 44 41 66 72 65 71 63  |.nothr2 LDAfreqc|
000007c0  3a 43 4d 50 23 34 3a 42  43 53 6e 6f 74 68 72 33  |:CMP#4:BCSnothr3|
000007d0  3a 4c 44 41 66 63 3a 43  4d 50 23 97 22 42 22 3a  |:LDAfc:CMP#."B":|
000007e0  42 45 51 6e 6f 74 68 72  33 0d 01 90 50 20 2e 72  |BEQnothr3...P .r|
000007f0  65 76 65 72 73 68 6e 74  20 4c 44 41 23 35 3a 53  |evershnt LDA#5:S|
00000800  54 41 72 65 76 69 6e 67  3a 4c 44 41 23 26 46 46  |TAreving:LDA#&FF|
00000810  3a 53 54 41 72 65 76 65  72 73 65 3a 53 54 41 74  |:STAreverse:STAt|
00000820  75 72 62 6f 3a 53 54 41  6c 65 66 74 3a 53 54 41  |urbo:STAleft:STA|
00000830  72 69 67 68 74 3a 52 54  53 0d 01 9a 74 20 2e 6e  |right:RTS...t .n|
00000840  6f 74 68 72 33 20 4c 44  41 72 65 76 69 6e 67 3a  |othr3 LDAreving:|
00000850  42 45 51 6e 6f 74 68 72  65 76 3a 4c 44 41 66 72  |BEQnothrev:LDAfr|
00000860  65 71 61 3a 43 4d 50 23  33 38 3a 42 43 43 63 6f  |eqa:CMP#38:BCCco|
00000870  6e 74 68 72 65 76 3a 4c  44 41 66 72 65 71 62 3a  |nthrev:LDAfreqb:|
00000880  43 4d 50 23 33 38 3a 42  43 43 63 6f 6e 74 68 72  |CMP#38:BCCconthr|
00000890  65 76 3a 4c 44 41 66 72  65 71 63 3a 43 4d 50 23  |ev:LDAfreqc:CMP#|
000008a0  33 38 3a 42 43 53 6e 6f  74 68 72 65 76 0d 01 a4  |38:BCSnothrev...|
000008b0  49 20 2e 63 6f 6e 74 68  72 65 76 20 44 45 43 72  |I .conthrev DECr|
000008c0  65 76 69 6e 67 3a 4c 44  41 23 26 46 46 3a 53 54  |eving:LDA#&FF:ST|
000008d0  41 74 75 72 62 6f 3a 53  54 41 6c 65 66 74 3a 53  |Aturbo:STAleft:S|
000008e0  54 41 72 69 67 68 74 3a  53 54 41 72 65 76 65 72  |TAright:STArever|
000008f0  73 65 3a 52 54 53 0d 01  ae 1d 20 2e 6e 6f 74 68  |se:RTS.... .noth|
00000900  72 65 76 20 4c 44 41 23  30 3a 53 54 41 72 65 76  |rev LDA#0:STArev|
00000910  69 6e 67 0d 01 b8 21 20  5c 20 52 6f 74 61 74 65  |ing...! \ Rotate|
00000920  20 74 6f 20 66 61 63 65  20 62 61 6c 6c 20 28 4c  | to face ball (L|
00000930  33 31 30 29 0d 01 c2 4c  20 4c 44 41 66 62 3a 43  |310)...L LDAfb:C|
00000940  4d 50 23 97 22 42 22 3a  42 4e 45 6e 6f 74 74 65  |MP#."B":BNEnotte|
00000950  6e 64 6c 3a 4c 44 41 66  72 65 71 62 3a 43 4d 50  |ndl:LDAfreqb:CMP|
00000960  23 33 38 3a 42 43 43 6e  6f 74 74 65 6e 64 6c 3a  |#38:BCCnottendl:|
00000970  4c 44 41 23 30 3a 53 54  41 74 65 6e 64 69 6e 67  |LDA#0:STAtending|
00000980  0d 01 cc 60 20 2e 6e 6f  74 74 65 6e 64 6c 20 4c  |...` .nottendl L|
00000990  44 41 66 63 3a 43 4d 50  23 97 22 42 22 3a 42 4e  |DAfc:CMP#."B":BN|
000009a0  45 6e 6f 74 74 65 6e 64  72 3a 4c 44 41 66 72 65  |Enottendr:LDAfre|
000009b0  71 63 3a 43 4d 50 23 33  38 3a 42 43 43 6e 6f 74  |qc:CMP#38:BCCnot|
000009c0  74 65 6e 64 72 3a 4c 44  41 23 31 3a 53 54 41 74  |tendr:LDA#1:STAt|
000009d0  65 6e 64 69 6e 67 3a 2e  6e 6f 74 74 65 6e 64 72  |ending:.nottendr|
000009e0  0d 01 d6 1e 20 5c 50 69  63 6b 20 62 65 73 74 20  |.... \Pick best |
000009f0  62 61 6c 6c 20 74 6f 20  61 69 6d 20 61 74 0d 01  |ball to aim at..|
00000a00  e0 b9 20 4c 44 41 66 72  65 71 61 3a 4c 53 52 20  |.. LDAfreqa:LSR |
00000a10  41 3a 4c 53 52 20 41 3a  53 54 41 26 38 30 3a 41  |A:LSR A:STA&80:A|
00000a20  53 4c 20 41 3a 43 4c 43  3a 41 44 43 26 38 30 3a  |SL A:CLC:ADC&80:|
00000a30  50 48 41 3a 43 4d 50 66  72 65 71 62 3a 42 43 43  |PHA:CMPfreqb:BCC|
00000a40  6e 6f 74 68 6e 6c 3a 4c  44 41 66 62 3a 43 4d 50  |nothnl:LDAfb:CMP|
00000a50  23 97 22 42 22 3a 42 4e  45 6e 6f 74 68 6e 6c 3a  |#."B":BNEnothnl:|
00000a60  4c 44 41 66 63 3a 43 4d  50 23 97 22 42 22 3a 42  |LDAfc:CMP#."B":B|
00000a70  4e 45 68 6e 6c 3a 4c 44  41 66 72 65 71 62 3a 43  |NEhnl:LDAfreqb:C|
00000a80  4d 50 66 72 65 71 63 3a  42 43 53 6e 6f 74 68 6e  |MPfreqc:BCSnothn|
00000a90  6c 3a 2e 68 6e 6c 20 4c  44 41 23 26 46 46 3a 53  |l:.hnl LDA#&FF:S|
00000aa0  54 41 6c 65 66 74 3a 53  54 41 73 74 65 65 72 3a  |TAleft:STAsteer:|
00000ab0  50 4c 41 3a 52 54 53 0d  01 ea 97 20 2e 6e 6f 74  |PLA:RTS.... .not|
00000ac0  68 6e 6c 20 50 4c 41 3a  43 4d 50 66 72 65 71 63  |hnl PLA:CMPfreqc|
00000ad0  3a 42 43 43 6e 6f 74 68  6e 72 3a 4c 44 41 66 63  |:BCCnothnr:LDAfc|
00000ae0  3a 43 4d 50 23 97 22 42  22 3a 42 4e 45 6e 6f 74  |:CMP#."B":BNEnot|
00000af0  68 6e 72 3a 4c 44 41 66  62 3a 43 4d 50 23 97 22  |hnr:LDAfb:CMP#."|
00000b00  42 22 3a 42 4e 45 68 6e  72 3a 4c 44 41 66 72 65  |B":BNEhnr:LDAfre|
00000b10  71 63 3a 43 4d 50 66 72  65 71 62 3a 42 43 53 6e  |qc:CMPfreqb:BCSn|
00000b20  6f 74 68 6e 72 3a 2e 68  6e 72 20 4c 44 41 23 26  |othnr:.hnr LDA#&|
00000b30  46 46 3a 53 54 41 72 69  67 68 74 3a 4c 44 41 23  |FF:STAright:LDA#|
00000b40  31 3a 53 54 41 73 74 65  65 72 3a 52 54 53 0d 01  |1:STAsteer:RTS..|
00000b50  f4 91 20 2e 6e 6f 74 68  6e 72 20 4c 44 41 66 61  |.. .nothnr LDAfa|
00000b60  3a 43 4d 50 23 97 22 42  22 3a 42 4e 45 6c 33 37  |:CMP#."B":BNEl37|
00000b70  30 3a 4c 44 58 23 30 3a  4c 44 41 73 74 65 65 72  |0:LDX#0:LDAsteer|
00000b80  3a 43 4d 50 23 31 3a 42  45 51 6e 6f 66 61 61 64  |:CMP#1:BEQnofaad|
00000b90  64 3a 4c 44 58 23 26 46  46 3a 2e 6e 6f 66 61 61  |d:LDX#&FF:.nofaa|
00000ba0  64 64 20 53 54 58 6c 65  66 74 3a 4c 44 58 23 30  |dd STXleft:LDX#0|
00000bb0  3a 43 4d 50 23 26 46 46  3a 42 45 51 6e 6f 66 61  |:CMP#&FF:BEQnofa|
00000bc0  61 64 64 32 3a 4c 44 58  23 26 46 46 3a 2e 6e 6f  |add2:LDX#&FF:.no|
00000bd0  66 61 61 64 64 32 20 53  54 58 72 69 67 68 74 0d  |faadd2 STXright.|
00000be0  01 fe 75 20 4c 44 41 23  30 3a 53 54 41 73 74 65  |..u LDA#0:STAste|
00000bf0  65 72 3a 4c 44 41 73 65  61 72 63 68 69 6e 67 3a  |er:LDAsearching:|
00000c00  4c 53 52 20 41 3a 53 54  41 73 65 61 72 63 68 69  |LSR A:STAsearchi|
00000c10  6e 67 3a 4c 44 58 23 30  3a 4c 44 41 66 72 65 71  |ng:LDX#0:LDAfreq|
00000c20  61 3a 43 4d 50 23 32 35  3a 42 43 43 6e 6f 66 61  |a:CMP#25:BCCnofa|
00000c30  61 64 64 33 3a 4c 44 58  23 26 46 46 3a 2e 6e 6f  |add3:LDX#&FF:.no|
00000c40  66 61 61 64 64 33 20 53  54 58 20 74 75 72 62 6f  |faadd3 STX turbo|
00000c50  3a 52 54 53 0d 02 08 3e  20 2e 6c 33 37 30 20 4c  |:RTS...> .l370 L|
00000c60  44 41 66 62 3a 43 4d 50  23 97 22 42 22 3a 42 4e  |DAfb:CMP#."B":BN|
00000c70  45 6c 33 38 30 3a 4c 44  41 23 26 46 46 3a 53 54  |El380:LDA#&FF:ST|
00000c80  41 73 74 65 65 72 3a 53  54 41 6c 65 66 74 3a 52  |Asteer:STAleft:R|
00000c90  54 53 0d 02 12 4b 20 2e  6c 33 38 30 20 4c 44 41  |TS...K .l380 LDA|
00000ca0  66 63 3a 43 4d 50 23 97  22 42 22 3a 42 4e 45 6c  |fc:CMP#."B":BNEl|
00000cb0  33 39 30 3a 4c 44 41 23  31 3a 53 54 41 73 74 65  |390:LDA#1:STAste|
00000cc0  65 72 3a 4c 44 41 23 26  46 46 3a 53 54 41 72 69  |er:LDA#&FF:STAri|
00000cd0  67 68 74 3a 52 54 53 3a  2e 6c 33 39 30 0d 02 1c  |ght:RTS:.l390...|
00000ce0  2d 20 5c 20 49 66 20 6e  6f 20 62 61 6c 6c 20 69  |- \ If no ball i|
00000cf0  6e 20 73 69 67 68 74 2c  20 63 6f 6e 74 69 6e 75  |n sight, continu|
00000d00  65 20 72 6f 74 61 74 69  6f 6e 0d 02 26 aa 20 49  |e rotation..&. I|
00000d10  4e 43 73 65 61 72 63 68  69 6e 67 3a 4c 44 41 23  |NCsearching:LDA#|
00000d20  30 3a 53 54 41 73 74 65  65 72 3a 53 54 41 74 75  |0:STAsteer:STAtu|
00000d30  72 62 6f 3a 53 54 41 73  74 65 65 72 3a 4c 44 41  |rbo:STAsteer:LDA|
00000d40  73 65 61 72 63 68 69 6e  67 3a 43 4d 50 23 36 3a  |searching:CMP#6:|
00000d50  42 43 43 6e 6f 74 74 75  72 72 6f 74 3a 4c 44 41  |BCCnotturrot:LDA|
00000d60  23 26 46 46 3a 53 54 41  74 75 72 62 6f 3a 2e 6e  |#&FF:STAturbo:.n|
00000d70  6f 74 74 75 72 72 6f 74  20 4c 44 58 23 26 46 46  |otturrot LDX#&FF|
00000d80  3a 4c 44 41 74 65 6e 64  69 6e 67 3a 42 45 51 74  |:LDAtending:BEQt|
00000d90  65 6e 64 30 3a 53 54 58  72 69 67 68 74 3a 4a 4d  |end0:STXright:JM|
00000da0  50 6c 34 33 30 3a 2e 74  65 6e 64 30 20 53 54 58  |Pl430:.tend0 STX|
00000db0  6c 65 66 74 0d 02 30 3f  20 2e 6c 34 33 30 20 4c  |left..0? .l430 L|
00000dc0  44 41 73 65 61 72 63 68  69 6e 67 3a 43 4d 50 23  |DAsearching:CMP#|
00000dd0  35 3a 42 4e 45 6c 34 34  30 3a 4c 44 41 74 65 6e  |5:BNEl440:LDAten|
00000de0  64 69 6e 67 3a 82 23 31  3a 53 54 41 74 65 6e 64  |ding:.#1:STAtend|
00000df0  69 6e 67 0d 02 3a 39 20  2e 6c 34 34 30 20 4c 44  |ing..:9 .l440 LD|
00000e00  41 73 65 61 72 63 68 69  6e 67 3a 43 4d 50 23 35  |Asearching:CMP#5|
00000e10  30 3a 42 43 43 6c 34 35  30 3a 49 4e 43 73 74 61  |0:BCCl450:INCsta|
00000e20  67 65 3a 2e 6c 34 35 30  20 52 54 53 0d 02 44 08  |ge:.l450 RTS..D.|
00000e30  20 52 54 53 0d 02 4e 06  20 3a 0d 02 58 bb 20 2e  | RTS..N. :..X. .|
00000e40  6d 6f 76 65 6f 75 74 20  4c 44 41 66 72 65 71 61  |moveout LDAfreqa|
00000e50  3a 43 4d 50 23 38 3a 42  43 43 6d 6f 76 6f 6e 65  |:CMP#8:BCCmovone|
00000e60  74 3a 4c 44 41 66 72 65  71 62 3a 43 4d 50 23 38  |t:LDAfreqb:CMP#8|
00000e70  3a 42 43 43 6d 6f 76 6f  6e 65 74 3a 4c 44 41 66  |:BCCmovonet:LDAf|
00000e80  72 65 71 63 3a 43 4d 50  23 38 3a 42 43 43 6d 6f  |reqc:CMP#8:BCCmo|
00000e90  76 6f 6e 65 74 3a 4c 44  41 72 65 76 69 6e 67 3a  |vonet:LDAreving:|
00000ea0  42 45 51 6c 35 31 30 3a  4c 44 41 66 72 65 71 61  |BEQl510:LDAfreqa|
00000eb0  3a 43 4d 50 23 31 39 3a  42 43 43 6d 6f 76 6f 6e  |:CMP#19:BCCmovon|
00000ec0  65 74 3a 4c 44 41 66 72  65 71 62 3a 43 4d 50 23  |et:LDAfreqb:CMP#|
00000ed0  31 39 3a 42 43 43 6d 6f  76 6f 6e 65 74 3a 4c 44  |19:BCCmovonet:LD|
00000ee0  41 66 72 65 71 63 3a 43  4d 50 23 31 39 3a 42 43  |Afreqc:CMP#19:BC|
00000ef0  53 6c 35 31 30 0d 02 62  3f 20 2e 6d 6f 76 6f 6e  |Sl510..b? .movon|
00000f00  65 74 20 4c 44 41 23 26  46 46 3a 53 54 41 72 65  |et LDA#&FF:STAre|
00000f10  76 69 6e 67 3a 53 54 41  72 65 76 65 72 73 65 3a  |ving:STAreverse:|
00000f20  53 54 41 6c 65 66 74 3a  53 54 41 72 69 67 68 74  |STAleft:STAright|
00000f30  3a 52 54 53 0d 02 6c a1  20 2e 6c 35 31 30 20 4c  |:RTS..l. .l510 L|
00000f40  44 41 23 30 3a 53 54 41  72 65 76 69 6e 67 3a 4c  |DA#0:STAreving:L|
00000f50  44 41 66 61 3a 43 4d 50  23 97 22 42 22 3a 42 45  |DAfa:CMP#."B":BE|
00000f60  51 67 6f 67 65 74 3a 4c  44 41 66 62 3a 43 4d 50  |Qgoget:LDAfb:CMP|
00000f70  23 97 22 42 22 3a 42 45  51 67 6f 67 65 74 3a 4c  |#."B":BEQgoget:L|
00000f80  44 41 66 63 3a 43 4d 50  23 97 22 42 22 3a 42 45  |DAfc:CMP#."B":BE|
00000f90  51 67 6f 67 65 74 3a 4c  44 41 66 64 3a 43 4d 50  |Qgoget:LDAfd:CMP|
00000fa0  23 97 22 42 22 3a 42 4e  45 6c 35 34 30 3a 2e 67  |#."B":BNEl540:.g|
00000fb0  6f 67 65 74 20 44 45 43  73 74 61 67 65 3a 4c 44  |oget DECstage:LD|
00000fc0  41 23 34 34 3a 53 54 41  73 65 61 72 63 68 69 6e  |A#44:STAsearchin|
00000fd0  67 3a 52 54 53 0d 02 76  53 20 2e 6c 35 34 30 20  |g:RTS..vS .l540 |
00000fe0  4c 44 41 66 61 3a 43 4d  50 23 97 22 4e 22 3a 42  |LDAfa:CMP#."N":B|
00000ff0  45 51 6d 6f 76 6f 72 69  67 3a 43 4d 50 23 97 22  |EQmovorig:CMP#."|
00001000  50 22 3a 42 4e 45 6c 35  36 30 3a 2e 6d 6f 76 6f  |P":BNEl560:.movo|
00001010  72 69 67 20 4c 44 41 23  26 46 46 3a 53 54 41 72  |rig LDA#&FF:STAr|
00001020  69 67 68 74 3a 52 54 53  0d 02 80 46 20 2e 6c 35  |ight:RTS...F .l5|
00001030  36 30 20 4c 44 41 66 62  3a 43 4d 50 23 97 22 4e  |60 LDAfb:CMP#."N|
00001040  22 3a 42 45 51 6c 35 38  30 3a 43 4d 50 23 97 22  |":BEQl580:CMP#."|
00001050  50 22 3a 42 45 51 6c 35  37 30 3a 4c 44 41 23 26  |P":BEQl570:LDA#&|
00001060  46 46 3a 53 54 41 6c 65  66 74 3a 52 54 53 0d 02  |FF:STAleft:RTS..|
00001070  8a 45 20 2e 6c 35 37 30  20 4c 44 41 66 72 65 71  |.E .l570 LDAfreq|
00001080  62 3a 43 4d 50 23 33 38  3a 42 43 53 6c 35 38 30  |b:CMP#38:BCSl580|
00001090  3a 4c 44 41 23 26 46 46  3a 53 54 41 72 69 67 68  |:LDA#&FF:STArigh|
000010a0  74 3a 4c 44 41 23 31 3a  53 54 41 6e 65 61 72 3a  |t:LDA#1:STAnear:|
000010b0  52 54 53 0d 02 94 30 20  2e 6c 35 38 30 20 4c 44  |RTS...0 .l580 LD|
000010c0  41 23 26 46 46 3a 53 54  41 74 75 72 62 6f 3a 53  |A#&FF:STAturbo:S|
000010d0  54 41 6c 65 66 74 3a 53  54 41 72 69 67 68 74 3a  |TAleft:STAright:|
000010e0  52 54 53 0d 02 9e 54 20  2e 64 6f 6e 65 61 72 73  |RTS...T .donears|
000010f0  74 75 66 66 20 4c 44 41  66 72 65 71 61 3a 43 4d  |tuff LDAfreqa:CM|
00001100  50 23 38 3a 42 43 53 6c  36 34 30 3a 4c 44 41 66  |P#8:BCSl640:LDAf|
00001110  61 3a 43 4d 50 23 97 22  42 22 3a 42 45 51 6c 36  |a:CMP#."B":BEQl6|
00001120  34 30 3a 4c 44 41 23 26  46 46 3a 53 54 41 72 69  |40:LDA#&FF:STAri|
00001130  67 68 74 3a 52 54 53 0d  02 a8 54 20 2e 6c 36 34  |ght:RTS...T .l64|
00001140  30 20 4c 44 41 6e 65 61  72 3a 43 4d 50 23 31 3a  |0 LDAnear:CMP#1:|
00001150  42 4e 45 6c 36 35 30 3a  4c 44 41 66 64 3a 43 4d  |BNEl650:LDAfd:CM|
00001160  50 23 97 22 55 22 3a 42  45 51 6c 36 35 30 3a 4c  |P#."U":BEQl650:L|
00001170  44 41 23 26 46 46 3a 53  54 41 6c 65 66 74 3a 53  |DA#&FF:STAleft:S|
00001180  54 41 72 69 67 68 74 3a  52 54 53 0d 02 b2 58 20  |TAright:RTS...X |
00001190  2e 6c 36 35 30 20 49 4e  43 6e 65 61 72 3a 4c 44  |.l650 INCnear:LD|
000011a0  41 23 26 46 46 3a 53 54  41 6c 65 66 74 3a 53 54  |A#&FF:STAleft:ST|
000011b0  41 74 75 72 62 6f 3a 4c  44 41 6e 65 61 72 3a 80  |Aturbo:LDAnear:.|
000011c0  23 31 3a 42 45 51 6e 65  61 72 6c 3a 4c 44 41 23  |#1:BEQnearl:LDA#|
000011d0  26 46 46 3a 2e 6e 65 61  72 6c 20 53 54 41 72 69  |&FF:.nearl STAri|
000011e0  67 68 74 0d 02 bc 60 20  4c 44 41 6e 65 61 72 3a  |ght...` LDAnear:|
000011f0  43 4d 50 23 31 38 3a 42  43 43 6e 65 61 72 65 6e  |CMP#18:BCCnearen|
00001200  64 3a 4c 44 41 23 30 3a  53 54 41 6e 65 61 72 3a  |d:LDA#0:STAnear:|
00001210  53 54 41 73 65 61 72 63  68 69 6e 67 3a 49 4e 43  |STAsearching:INC|
00001220  73 74 61 67 65 3a 4c 44  41 23 31 3a 53 54 41 74  |stage:LDA#1:STAt|
00001230  65 6e 64 69 6e 67 3a 2e  6e 65 61 72 65 6e 64 20  |ending:.nearend |
00001240  52 54 53 0d 02 c6 7f 20  2e 72 65 6c 65 61 73 65  |RTS.... .release|
00001250  62 20 4c 44 41 23 26 46  46 3a 53 54 41 6c 65 66  |b LDA#&FF:STAlef|
00001260  74 3a 53 54 41 72 69 67  68 74 3a 53 54 41 72 65  |t:STAright:STAre|
00001270  76 65 72 73 65 3a 53 54  41 74 75 72 62 6f 3a 49  |verse:STAturbo:I|
00001280  4e 43 6e 65 61 72 3a 4c  44 41 6e 65 61 72 3a 43  |NCnear:LDAnear:C|
00001290  4d 50 23 31 30 3a 42 43  43 6e 65 61 72 65 6e 64  |MP#10:BCCnearend|
000012a0  3a 4c 44 41 23 30 3a 53  54 41 6e 65 61 72 3a 4c  |:LDA#0:STAnear:L|
000012b0  44 41 23 26 46 46 3a 53  54 41 69 64 6c 65 3a 52  |DA#&FF:STAidle:R|
000012c0  54 53 0d 02 d0 08 20 5d  3a ed 0d 02 da 1b 20 ff  |TS.... ]:..... .|
000012d0  20 22 53 41 56 45 20 41  49 20 33 30 30 30 20 22  | "SAVE AI 3000 "|
000012e0  2b c3 7e 4f 25 0d ff                              |+.~O%..|
000012e7