Home » CEEFAX disks » telesoftware5.adl » 07-02-88/T\SWR15

07-02-88/T\SWR15

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 » telesoftware5.adl
Filename: 07-02-88/T\SWR15
Read OK:
File size: 3A4E bytes
Load address: 0000
Exec address: FFFFFFFF
Duplicates

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

File contents
Mastering Sideways ROM & RAM - Module 15 - Multi command interpreter
--------------------------------------------------------------------


  Up until now, all the modules of the course that have used an
unrecognised * command interpreter to demonstrate a programming
technique have used a one-command interpreter. In this module I will
introduce a multiple command interpreter which can be used to
implement one or more new * commands per SWR bank.

  The multiple command interpreter is much more complicated than the
simple one-command version. It includes an optional prefix character
for the commands as well as command shortening with a dot.

  Prefixing commands with an optional character is quite a useful
feature to include in your interpreters. Not only does it make your
work look more professional but it is very useful if the command names
you choose for your rom clash with those in a higher priority rom. If,
for example, your rom uses the command *DUMP and it is in a lower
priority rom socket than the DFS rom then the command will always be
intercepted by the DFS before your interpreter has a chance to
recognise it. If you use an optional "X" prefix your rom will get the
opportunity to intercept the command as long as the equivalent *XDUMP
command is ignored by the DFS rom.

  Because the interpreter is used to implement more than one command
you can not use the title string in the header as a command name,
although the title string should still be included in the header to
identify the rom image.

  The single command name has to be replaced with a multiple command
name table. Each name in the table is followed by a two byte address.
This is the address of the routine associated with the command name.
Each address is stored in the table with the high byte of the address
followed by the low byte. This breaks with the 6502 convention of
storing the low byte first but it is done so that the high byte, which
must have the most significant bit set, can be used as an end of
command name marker as well as part of the address. The byte &FF is
used as a termination character in the command table.

  The command table used in the example program is shown in BASIC 2
Assembler in figure 15.1.




.commtable
        EQUS "SIREN"       \ command string
        EQUB siren DIV 256 \ end of command marker & ms byte
        EQUB siren MOD 256 \ ls byte
        EQUS "HEHE"        \ command string
        EQUB hehe DIV 256  \ end of command marker & ms byte
        EQUB hehe MOD 256  \ ls byte
        EQUS "UFO"         \ command string
        EQUB ufo DIV 256   \ end of command marker & ms byte
        EQUB ufo MOD 256   \ ls byte
        EQUB &FF           \ termination character

Figure 15.1  The new command table.
-----------  ----------------------




  The interpreter intercepts service call 4 and then compares the
unrecognised command with each command in the command table. If a
match is found the command address is taken from the command table and
stored in two consecutive zero page bytes which are used to make an
indirect jump to the new routine.

  The order of the commands in the table is very important. The
longest command name must be at the head of the table and the shortest
at the end. The reason for this is that if two commands such as *RED
and *REDUCE are included in the table and the unrecognised command is
compared with RED before REDUCE then *REDUCE will be recognised as
*RED with the argument "UCE". The commands in the table must all be
upper case alphabetic characters and must not start with the optional
character, in this example "X". Numbers and punctuation characters
must not be used because the unrecognised command is forced to upper
case by ANDing it with #&DF.

  The three new routines in the example program SOUNDS are called with
*SIREN, *HEHE, and *UFO. All three routines are the machine code
equivalent of the ENVELOPE and SOUND commands suggested by their
names.

  Load the object code generated by SOUNDS into SWR and press the
Break key. The command *HEHE can be shortened to three characters
(*HEH.) but if it is shortened further (*HE.) the command clashes with
the *HELP command. The optional prefix has to be used (*XH.) if you
want to shorten the command to two characters.

  The multiple command interpreter intercepts service call 4 (lines
280-310) and pushes the registers (lines 320-360) and two zero page
bytes (lines 370-400) on the stack.

  The X register is used as an offset on the command table address and
it is initialised with the value of &FE (line 410). The reason why X
is initialised to &FE, and not zero as you might expect, is that it is
incremented in the outer loop of the comparison routine (line 450) to
point to the byte before the first byte of each command in the table
and again in the inner loop (line 550) to point to every byte of each
command starting with the first byte. The Y register is the offset on
the unrecognised command text pointer and needs to be restored to its
initial value at the begining of each comparison. It is pushed on the
stack as a temporary store (lines 410-420).

  The outer loop of the comparison routine is in lines 450 to 700. The
outer loop points to each command in the command table. The X register
is incremented to point to the byte preceding the first byte of each
command (line 450) and the Y register is restored to its initial value
(lines 460-480). The first character of the unrecognised command is
read (line 490) and forced to upper case (line 500). It is compared
with the optional first character (line 510) and if it matches the Y
register is incremented to point to the next character (line 530). If
it does not match the Y register is not incremented so that the first
character will be read again and compared with the contents of the
command table.

  The inner loop of the comparison routine is in lines 550 to 640.
This loop compares every byte of each new command with every byte of
the unrecognised command and recognises a command if either all the
pairs of bytes match or if all pairs of bytes match until a dot is
read at the end of the unrecognised command.

  The X register is incremented (line 550) to point to the first byte
of a command in the command table. The byte pointed to by the offset
in X is read (line 560) and tested (line 570) to see if it is the end
of command marker (the most significant byte of the address bytes).
When the command name and unrecognised command match the end of
command marker will be read and control is passed to the label
".found". Control is also passed to ".found" when the termination
character (&FF) is read. If the end of command marker or termination
character is not read the next byte in the unrecognised command is
compared with "." (lines 580-600). If the next character is a dot
control is passed to the label ".foundot".

  The inner loop in lines 550 to 640 exits when a mismatch in the
pairs of bytes is found. When a mismatch occurs the X register is
pointed to the end of command marker (lines 660-680) and the marker is
compared with &FF to see if it is the command table termination
character (line 690). If the termination character is found the zero
page bytes and registers are restored and control is passed back to
the MOS (lines 720-820). If it is not the routine branches back to the
label ".firstchar" (line 440) to compare the unrecognised command with
the next command in the table.

  When a command shortened with a dot is recognised control is passed
to the label ".foundot" (line 830). The X register is then incremented
until it points to the end of command marker (lines 840-860).

  An unshortened command passes control to the label ".found" (line
870). The accumulator is compared with &FF to see if the termination
character has been read. If it has then none of the commands match the
unrecognised command and so the registers are restored and control
passes back to the MOS (lines 710-820). If the accumulator does not
contain the termination character it must contain the most significant
byte of the new routine. This is stored in the most significant of the
two consecutive zero page bytes (line 900). The X register is
incremented to point to the byte storing the least significant byte of
the new routine's address (line 910). This byte is loaded into the
accumulator (line 920) and stored in the least significant of the two
zero page bytes (line 930). The Y register was pushed on the stack as
a temporary store and is pulled off and discarded (line 940). The
argument is initialised (lines 950-960) and an indirect jump is made
to the new routine (line 970).

  After the new routine has been executed the two zero page bytes used
for the indirect jump are restored (lines 1190-1220), the stack is
balanced (lines 1230-1250), the accumulator is loaded with zero to
indicate that the command has been recognised (line 1260) and control
is passed back to the MOS (line 1270).

  Understanding and explaining how the interpreter works is much more
difficult than using it. In order to use this interpreter with your
own programs you only need to add the command names to the command
table and, of course, the new routines. You don't need to alter the
coding of the interpreter at all which makes it very easy to adapt for
your own software. When you adapt your own programs to run in SWR with
this interpreter you must not forget to use a routine, such as the one
in lines 1180 to 1270, which restores the two zero page bytes and
balances the stack before returning control to the MOS. Restoring the
memory used by the interpreter, balancing the stack and loading the
accumulator with zero before returning is absolutely vital. This
multiple command interpreter will not work properly if you leave out
this essential last routine.

  This interpreter will be developed further in the next module to
include a *HELP service.





   10 REM: SOUNDS
   20 MODE7
   30 HIMEM=&3C00
   40 DIM save 50
   50 diff=&8000-HIMEM
   60 address=&70
   70 comvec=&F2
   80 gsinit=&FFC2
   90 gsread=&FFC5
  100 osword=&FFF1
  110 oscli=&FFF7
  120 FOR pass = 0 TO 2 STEP 2
  130 P%=HIMEM
  140 [       OPT pass
  150         BRK
  160         BRK
  170         BRK
  180         JMP service+diff
  190         OPT FNequb(&82)
  200         OPT FNequb((copyright+diff) MOD 256)
  210         BRK
  220         OPT FNequs("SOUNDS")
  230 .copyright
  240         BRK
  250         OPT FNequs("(C) Gordon Horsington 1987")
  260         BRK
  270 .service
  280         CMP #4
  290         BEQ unrecognised
  300         RTS
  310 .unrecognised
  320         PHA
  330         TXA
  340         PHA
  350         TYA
  360         PHA
  370         LDA address
  380         PHA
  390         LDA address+1
  400         PHA
  410         LDX #&FE
  420         TYA
  430         PHA
  440 .firstchar
  450         INX
  460         PLA
  470         TAY
  480         PHA
  490         LDA (comvec),Y
  500         AND #&DF
  510         CMP #ASC("X")
  520         BNE interpret
  530         INY
  540 .interpret
  550         INX
  560         LDA commtable+diff,X
  570         BMI found
  580         LDA (comvec),Y
  590         INY
  600         CMP #ASC(".")
  610         BEQ founddot
  620         AND #&DF
  630         CMP commtable+diff,X
  640         BEQ interpret
  650 .another
  660         INX
  670         LDA commtable+diff,X
  680         BPL another
  690         CMP #&FF
  700         BNE firstchar
  710 .exit
  720         PLA
  730         PLA
  740         STA address+1
  750         PLA
  760         STA address
  770         PLA
  780         TAY
  790         PLA
  800         TAX
  810         PLA
  820         RTS
  830 .founddot
  840         INX
  850         LDA commtable+diff,X
  860         BPL founddot
  870 .found
  880         CMP #&FF
  890         BEQ exit
  900         STA address+1
  910         INX
  920         LDA commtable+diff,X
  930         STA address
  940         PLA
  950         SEC
  960         JSR gsinit
  970         JMP (address)
  980 .commtable
  990         OPT FNequs("SIREN")
 1000         OPT FNequb((siren+diff) DIV 256)
 1010         OPT FNequb((siren+diff) MOD 256)
 1020         OPT FNequs("HEHE")
 1030         OPT FNequb((hehe+diff) DIV 256)
 1040         OPT FNequb((hehe+diff) MOD 256)
 1050         OPT FNequs("UFO")
 1060         OPT FNequb((ufo+diff) DIV 256)
 1070         OPT FNequb((ufo+diff) MOD 256)
 1080         OPT FNequb(&FF)
 1090 .hehe
 1100         LDA #8
 1110         LDX #(ehehe+diff) MOD 256
 1120         LDY #(ehehe+diff) DIV 256
 1130         JSR osword    \ Envelope
 1140         LDA #7
 1150         LDX #(shehe+diff) MOD 256
 1160         LDY #(shehe+diff) DIV 256
 1170         JSR osword    \ Sound
 1180 .pullout
 1190         PLA
 1200         STA address+1
 1210         PLA
 1220         STA address
 1230         PLA
 1240         PLA
 1250         PLA
 1260         LDA #0
 1270         RTS
 1280 .siren
 1290         LDA #8
 1300         LDX #(esiren+diff) MOD 256
 1310         LDY #(esiren+diff) DIV 256
 1320         JSR osword    \ Envelope
 1330         LDA #7
 1340         LDX #(ssiren+diff) MOD 256
 1350         LDY #(ssiren+diff) DIV 256
 1360         JSR osword    \ Sound
 1370         JMP pullout+diff
 1380 .ufo
 1390         LDA #8
 1400         LDX #(eufo+diff) MOD 256
 1410         LDY #(eufo+diff) DIV 256
 1420         JSR osword    \ Envelope
 1430         LDA #7
 1440         LDX #(sufo+diff) MOD 256
 1450         LDY #(sufo+diff) DIV 256
 1460         JSR osword    \ Sound
 1470         JMP pullout+diff
 1480 .ehehe
 1490         OPT FNequd(&02FF0301)
 1500         OPT FNequd(&461E1E32)
 1510         OPT FNequd(&FFFFFF7F)
 1520         OPT FNequw(&7E7E)
 1530 .shehe
 1540         OPT FNequd(&00010011)
 1550         OPT FNequd(&00320075)
 1560 .esiren
 1570         OPT FNequd(&07F90102)
 1580         OPT FNequd(&000A0A00)
 1590         OPT FNequd(&8200007E)
 1600         OPT FNequw(&7E7E)
 1610 .ssiren
 1620         OPT FNequd(&00020012)
 1630         OPT FNequd(&00FF0088)
 1640 .eufo
 1650         OPT FNequd(&FF010103)
 1660         OPT FNequd(&01080700)
 1670         OPT FNequd(&FF00FF03)
 1680         OPT FNequw(&7E7E)
 1690 .sufo
 1700         OPT FNequd(&00030013)
 1710         OPT FNequd(&003C0082)
 1720 .lastbyte
 1730 ]
 1740 NEXT
 1750 INPUT'"Save filename = "filename$
 1760 IF filename$="" END
 1770 $save="SAVE "+filename$+" "+STR$~(HIMEM)+" "+STR$~(las
      tbyte)+" FFFF8000 FFFF8000"
 1780 X%=save MOD 256
 1790 Y%=save DIV 256
 1800 *OPT1,2
 1810 CALL oscli
 1820 *OPT1,0
 1830 END
 1840 DEFFNequb(byte)
 1850 ?P%=byte
 1860 P%=P%+1
 1870 =pass
 1880 DEFFNequw(word)
 1890 ?P%=word MOD 256
 1900 P%?1=word DIV 256
 1910 P%=P%+2
 1920 =pass
 1930 DEFFNequd(double)
 1940 !P%=double
 1950 P%=P%+4
 1960 =pass
 1970 DEFFNequs(string$)
 1980 $P%=string$
 1990 P%=P%+LEN(string$)
 2000 =pass
00000000  4d 61 73 74 65 72 69 6e  67 20 53 69 64 65 77 61  |Mastering Sidewa|
00000010  79 73 20 52 4f 4d 20 26  20 52 41 4d 20 2d 20 4d  |ys ROM & RAM - M|
00000020  6f 64 75 6c 65 20 31 35  20 2d 20 4d 75 6c 74 69  |odule 15 - Multi|
00000030  20 63 6f 6d 6d 61 6e 64  20 69 6e 74 65 72 70 72  | command interpr|
00000040  65 74 65 72 0d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |eter.-----------|
00000050  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000080  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0d 0d 20 20 55 70  |---------...  Up|
00000090  20 75 6e 74 69 6c 20 6e  6f 77 2c 20 61 6c 6c 20  | until now, all |
000000a0  74 68 65 20 6d 6f 64 75  6c 65 73 20 6f 66 20 74  |the modules of t|
000000b0  68 65 20 63 6f 75 72 73  65 20 74 68 61 74 20 68  |he course that h|
000000c0  61 76 65 20 75 73 65 64  20 61 6e 0d 75 6e 72 65  |ave used an.unre|
000000d0  63 6f 67 6e 69 73 65 64  20 2a 20 63 6f 6d 6d 61  |cognised * comma|
000000e0  6e 64 20 69 6e 74 65 72  70 72 65 74 65 72 20 74  |nd interpreter t|
000000f0  6f 20 64 65 6d 6f 6e 73  74 72 61 74 65 20 61 20  |o demonstrate a |
00000100  70 72 6f 67 72 61 6d 6d  69 6e 67 0d 74 65 63 68  |programming.tech|
00000110  6e 69 71 75 65 20 68 61  76 65 20 75 73 65 64 20  |nique have used |
00000120  61 20 6f 6e 65 2d 63 6f  6d 6d 61 6e 64 20 69 6e  |a one-command in|
00000130  74 65 72 70 72 65 74 65  72 2e 20 49 6e 20 74 68  |terpreter. In th|
00000140  69 73 20 6d 6f 64 75 6c  65 20 49 20 77 69 6c 6c  |is module I will|
00000150  0d 69 6e 74 72 6f 64 75  63 65 20 61 20 6d 75 6c  |.introduce a mul|
00000160  74 69 70 6c 65 20 63 6f  6d 6d 61 6e 64 20 69 6e  |tiple command in|
00000170  74 65 72 70 72 65 74 65  72 20 77 68 69 63 68 20  |terpreter which |
00000180  63 61 6e 20 62 65 20 75  73 65 64 20 74 6f 0d 69  |can be used to.i|
00000190  6d 70 6c 65 6d 65 6e 74  20 6f 6e 65 20 6f 72 20  |mplement one or |
000001a0  6d 6f 72 65 20 6e 65 77  20 2a 20 63 6f 6d 6d 61  |more new * comma|
000001b0  6e 64 73 20 70 65 72 20  53 57 52 20 62 61 6e 6b  |nds per SWR bank|
000001c0  2e 0d 0d 20 20 54 68 65  20 6d 75 6c 74 69 70 6c  |...  The multipl|
000001d0  65 20 63 6f 6d 6d 61 6e  64 20 69 6e 74 65 72 70  |e command interp|
000001e0  72 65 74 65 72 20 69 73  20 6d 75 63 68 20 6d 6f  |reter is much mo|
000001f0  72 65 20 63 6f 6d 70 6c  69 63 61 74 65 64 20 74  |re complicated t|
00000200  68 61 6e 20 74 68 65 0d  73 69 6d 70 6c 65 20 6f  |han the.simple o|
00000210  6e 65 2d 63 6f 6d 6d 61  6e 64 20 76 65 72 73 69  |ne-command versi|
00000220  6f 6e 2e 20 49 74 20 69  6e 63 6c 75 64 65 73 20  |on. It includes |
00000230  61 6e 20 6f 70 74 69 6f  6e 61 6c 20 70 72 65 66  |an optional pref|
00000240  69 78 20 63 68 61 72 61  63 74 65 72 0d 66 6f 72  |ix character.for|
00000250  20 74 68 65 20 63 6f 6d  6d 61 6e 64 73 20 61 73  | the commands as|
00000260  20 77 65 6c 6c 20 61 73  20 63 6f 6d 6d 61 6e 64  | well as command|
00000270  20 73 68 6f 72 74 65 6e  69 6e 67 20 77 69 74 68  | shortening with|
00000280  20 61 20 64 6f 74 2e 0d  0d 20 20 50 72 65 66 69  | a dot...  Prefi|
00000290  78 69 6e 67 20 63 6f 6d  6d 61 6e 64 73 20 77 69  |xing commands wi|
000002a0  74 68 20 61 6e 20 6f 70  74 69 6f 6e 61 6c 20 63  |th an optional c|
000002b0  68 61 72 61 63 74 65 72  20 69 73 20 71 75 69 74  |haracter is quit|
000002c0  65 20 61 20 75 73 65 66  75 6c 0d 66 65 61 74 75  |e a useful.featu|
000002d0  72 65 20 74 6f 20 69 6e  63 6c 75 64 65 20 69 6e  |re to include in|
000002e0  20 79 6f 75 72 20 69 6e  74 65 72 70 72 65 74 65  | your interprete|
000002f0  72 73 2e 20 4e 6f 74 20  6f 6e 6c 79 20 64 6f 65  |rs. Not only doe|
00000300  73 20 69 74 20 6d 61 6b  65 20 79 6f 75 72 0d 77  |s it make your.w|
00000310  6f 72 6b 20 6c 6f 6f 6b  20 6d 6f 72 65 20 70 72  |ork look more pr|
00000320  6f 66 65 73 73 69 6f 6e  61 6c 20 62 75 74 20 69  |ofessional but i|
00000330  74 20 69 73 20 76 65 72  79 20 75 73 65 66 75 6c  |t is very useful|
00000340  20 69 66 20 74 68 65 20  63 6f 6d 6d 61 6e 64 20  | if the command |
00000350  6e 61 6d 65 73 0d 79 6f  75 20 63 68 6f 6f 73 65  |names.you choose|
00000360  20 66 6f 72 20 79 6f 75  72 20 72 6f 6d 20 63 6c  | for your rom cl|
00000370  61 73 68 20 77 69 74 68  20 74 68 6f 73 65 20 69  |ash with those i|
00000380  6e 20 61 20 68 69 67 68  65 72 20 70 72 69 6f 72  |n a higher prior|
00000390  69 74 79 20 72 6f 6d 2e  20 49 66 2c 0d 66 6f 72  |ity rom. If,.for|
000003a0  20 65 78 61 6d 70 6c 65  2c 20 79 6f 75 72 20 72  | example, your r|
000003b0  6f 6d 20 75 73 65 73 20  74 68 65 20 63 6f 6d 6d  |om uses the comm|
000003c0  61 6e 64 20 2a 44 55 4d  50 20 61 6e 64 20 69 74  |and *DUMP and it|
000003d0  20 69 73 20 69 6e 20 61  20 6c 6f 77 65 72 0d 70  | is in a lower.p|
000003e0  72 69 6f 72 69 74 79 20  72 6f 6d 20 73 6f 63 6b  |riority rom sock|
000003f0  65 74 20 74 68 61 6e 20  74 68 65 20 44 46 53 20  |et than the DFS |
00000400  72 6f 6d 20 74 68 65 6e  20 74 68 65 20 63 6f 6d  |rom then the com|
00000410  6d 61 6e 64 20 77 69 6c  6c 20 61 6c 77 61 79 73  |mand will always|
00000420  20 62 65 0d 69 6e 74 65  72 63 65 70 74 65 64 20  | be.intercepted |
00000430  62 79 20 74 68 65 20 44  46 53 20 62 65 66 6f 72  |by the DFS befor|
00000440  65 20 79 6f 75 72 20 69  6e 74 65 72 70 72 65 74  |e your interpret|
00000450  65 72 20 68 61 73 20 61  20 63 68 61 6e 63 65 20  |er has a chance |
00000460  74 6f 0d 72 65 63 6f 67  6e 69 73 65 20 69 74 2e  |to.recognise it.|
00000470  20 49 66 20 79 6f 75 20  75 73 65 20 61 6e 20 6f  | If you use an o|
00000480  70 74 69 6f 6e 61 6c 20  22 58 22 20 70 72 65 66  |ptional "X" pref|
00000490  69 78 20 79 6f 75 72 20  72 6f 6d 20 77 69 6c 6c  |ix your rom will|
000004a0  20 67 65 74 20 74 68 65  0d 6f 70 70 6f 72 74 75  | get the.opportu|
000004b0  6e 69 74 79 20 74 6f 20  69 6e 74 65 72 63 65 70  |nity to intercep|
000004c0  74 20 74 68 65 20 63 6f  6d 6d 61 6e 64 20 61 73  |t the command as|
000004d0  20 6c 6f 6e 67 20 61 73  20 74 68 65 20 65 71 75  | long as the equ|
000004e0  69 76 61 6c 65 6e 74 20  2a 58 44 55 4d 50 0d 63  |ivalent *XDUMP.c|
000004f0  6f 6d 6d 61 6e 64 20 69  73 20 69 67 6e 6f 72 65  |ommand is ignore|
00000500  64 20 62 79 20 74 68 65  20 44 46 53 20 72 6f 6d  |d by the DFS rom|
00000510  2e 0d 0d 20 20 42 65 63  61 75 73 65 20 74 68 65  |...  Because the|
00000520  20 69 6e 74 65 72 70 72  65 74 65 72 20 69 73 20  | interpreter is |
00000530  75 73 65 64 20 74 6f 20  69 6d 70 6c 65 6d 65 6e  |used to implemen|
00000540  74 20 6d 6f 72 65 20 74  68 61 6e 20 6f 6e 65 20  |t more than one |
00000550  63 6f 6d 6d 61 6e 64 0d  79 6f 75 20 63 61 6e 20  |command.you can |
00000560  6e 6f 74 20 75 73 65 20  74 68 65 20 74 69 74 6c  |not use the titl|
00000570  65 20 73 74 72 69 6e 67  20 69 6e 20 74 68 65 20  |e string in the |
00000580  68 65 61 64 65 72 20 61  73 20 61 20 63 6f 6d 6d  |header as a comm|
00000590  61 6e 64 20 6e 61 6d 65  2c 0d 61 6c 74 68 6f 75  |and name,.althou|
000005a0  67 68 20 74 68 65 20 74  69 74 6c 65 20 73 74 72  |gh the title str|
000005b0  69 6e 67 20 73 68 6f 75  6c 64 20 73 74 69 6c 6c  |ing should still|
000005c0  20 62 65 20 69 6e 63 6c  75 64 65 64 20 69 6e 20  | be included in |
000005d0  74 68 65 20 68 65 61 64  65 72 20 74 6f 0d 69 64  |the header to.id|
000005e0  65 6e 74 69 66 79 20 74  68 65 20 72 6f 6d 20 69  |entify the rom i|
000005f0  6d 61 67 65 2e 0d 0d 20  20 54 68 65 20 73 69 6e  |mage...  The sin|
00000600  67 6c 65 20 63 6f 6d 6d  61 6e 64 20 6e 61 6d 65  |gle command name|
00000610  20 68 61 73 20 74 6f 20  62 65 20 72 65 70 6c 61  | has to be repla|
00000620  63 65 64 20 77 69 74 68  20 61 20 6d 75 6c 74 69  |ced with a multi|
00000630  70 6c 65 20 63 6f 6d 6d  61 6e 64 0d 6e 61 6d 65  |ple command.name|
00000640  20 74 61 62 6c 65 2e 20  45 61 63 68 20 6e 61 6d  | table. Each nam|
00000650  65 20 69 6e 20 74 68 65  20 74 61 62 6c 65 20 69  |e in the table i|
00000660  73 20 66 6f 6c 6c 6f 77  65 64 20 62 79 20 61 20  |s followed by a |
00000670  74 77 6f 20 62 79 74 65  20 61 64 64 72 65 73 73  |two byte address|
00000680  2e 0d 54 68 69 73 20 69  73 20 74 68 65 20 61 64  |..This is the ad|
00000690  64 72 65 73 73 20 6f 66  20 74 68 65 20 72 6f 75  |dress of the rou|
000006a0  74 69 6e 65 20 61 73 73  6f 63 69 61 74 65 64 20  |tine associated |
000006b0  77 69 74 68 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |with the command|
000006c0  20 6e 61 6d 65 2e 0d 45  61 63 68 20 61 64 64 72  | name..Each addr|
000006d0  65 73 73 20 69 73 20 73  74 6f 72 65 64 20 69 6e  |ess is stored in|
000006e0  20 74 68 65 20 74 61 62  6c 65 20 77 69 74 68 20  | the table with |
000006f0  74 68 65 20 68 69 67 68  20 62 79 74 65 20 6f 66  |the high byte of|
00000700  20 74 68 65 20 61 64 64  72 65 73 73 0d 66 6f 6c  | the address.fol|
00000710  6c 6f 77 65 64 20 62 79  20 74 68 65 20 6c 6f 77  |lowed by the low|
00000720  20 62 79 74 65 2e 20 54  68 69 73 20 62 72 65 61  | byte. This brea|
00000730  6b 73 20 77 69 74 68 20  74 68 65 20 36 35 30 32  |ks with the 6502|
00000740  20 63 6f 6e 76 65 6e 74  69 6f 6e 20 6f 66 0d 73  | convention of.s|
00000750  74 6f 72 69 6e 67 20 74  68 65 20 6c 6f 77 20 62  |toring the low b|
00000760  79 74 65 20 66 69 72 73  74 20 62 75 74 20 69 74  |yte first but it|
00000770  20 69 73 20 64 6f 6e 65  20 73 6f 20 74 68 61 74  | is done so that|
00000780  20 74 68 65 20 68 69 67  68 20 62 79 74 65 2c 20  | the high byte, |
00000790  77 68 69 63 68 0d 6d 75  73 74 20 68 61 76 65 20  |which.must have |
000007a0  74 68 65 20 6d 6f 73 74  20 73 69 67 6e 69 66 69  |the most signifi|
000007b0  63 61 6e 74 20 62 69 74  20 73 65 74 2c 20 63 61  |cant bit set, ca|
000007c0  6e 20 62 65 20 75 73 65  64 20 61 73 20 61 6e 20  |n be used as an |
000007d0  65 6e 64 20 6f 66 0d 63  6f 6d 6d 61 6e 64 20 6e  |end of.command n|
000007e0  61 6d 65 20 6d 61 72 6b  65 72 20 61 73 20 77 65  |ame marker as we|
000007f0  6c 6c 20 61 73 20 70 61  72 74 20 6f 66 20 74 68  |ll as part of th|
00000800  65 20 61 64 64 72 65 73  73 2e 20 54 68 65 20 62  |e address. The b|
00000810  79 74 65 20 26 46 46 20  69 73 0d 75 73 65 64 20  |yte &FF is.used |
00000820  61 73 20 61 20 74 65 72  6d 69 6e 61 74 69 6f 6e  |as a termination|
00000830  20 63 68 61 72 61 63 74  65 72 20 69 6e 20 74 68  | character in th|
00000840  65 20 63 6f 6d 6d 61 6e  64 20 74 61 62 6c 65 2e  |e command table.|
00000850  0d 0d 20 20 54 68 65 20  63 6f 6d 6d 61 6e 64 20  |..  The command |
00000860  74 61 62 6c 65 20 75 73  65 64 20 69 6e 20 74 68  |table used in th|
00000870  65 20 65 78 61 6d 70 6c  65 20 70 72 6f 67 72 61  |e example progra|
00000880  6d 20 69 73 20 73 68 6f  77 6e 20 69 6e 20 42 41  |m is shown in BA|
00000890  53 49 43 20 32 0d 41 73  73 65 6d 62 6c 65 72 20  |SIC 2.Assembler |
000008a0  69 6e 20 66 69 67 75 72  65 20 31 35 2e 31 2e 0d  |in figure 15.1..|
000008b0  0d 0d 0d 0d 2e 63 6f 6d  6d 74 61 62 6c 65 0d 20  |.....commtable. |
000008c0  20 20 20 20 20 20 20 45  51 55 53 20 22 53 49 52  |       EQUS "SIR|
000008d0  45 4e 22 20 20 20 20 20  20 20 5c 20 63 6f 6d 6d  |EN"       \ comm|
000008e0  61 6e 64 20 73 74 72 69  6e 67 0d 20 20 20 20 20  |and string.     |
000008f0  20 20 20 45 51 55 42 20  73 69 72 65 6e 20 44 49  |   EQUB siren DI|
00000900  56 20 32 35 36 20 5c 20  65 6e 64 20 6f 66 20 63  |V 256 \ end of c|
00000910  6f 6d 6d 61 6e 64 20 6d  61 72 6b 65 72 20 26 20  |ommand marker & |
00000920  6d 73 20 62 79 74 65 0d  20 20 20 20 20 20 20 20  |ms byte.        |
00000930  45 51 55 42 20 73 69 72  65 6e 20 4d 4f 44 20 32  |EQUB siren MOD 2|
00000940  35 36 20 5c 20 6c 73 20  62 79 74 65 0d 20 20 20  |56 \ ls byte.   |
00000950  20 20 20 20 20 45 51 55  53 20 22 48 45 48 45 22  |     EQUS "HEHE"|
00000960  20 20 20 20 20 20 20 20  5c 20 63 6f 6d 6d 61 6e  |        \ comman|
00000970  64 20 73 74 72 69 6e 67  0d 20 20 20 20 20 20 20  |d string.       |
00000980  20 45 51 55 42 20 68 65  68 65 20 44 49 56 20 32  | EQUB hehe DIV 2|
00000990  35 36 20 20 5c 20 65 6e  64 20 6f 66 20 63 6f 6d  |56  \ end of com|
000009a0  6d 61 6e 64 20 6d 61 72  6b 65 72 20 26 20 6d 73  |mand marker & ms|
000009b0  20 62 79 74 65 0d 20 20  20 20 20 20 20 20 45 51  | byte.        EQ|
000009c0  55 42 20 68 65 68 65 20  4d 4f 44 20 32 35 36 20  |UB hehe MOD 256 |
000009d0  20 5c 20 6c 73 20 62 79  74 65 0d 20 20 20 20 20  | \ ls byte.     |
000009e0  20 20 20 45 51 55 53 20  22 55 46 4f 22 20 20 20  |   EQUS "UFO"   |
000009f0  20 20 20 20 20 20 5c 20  63 6f 6d 6d 61 6e 64 20  |      \ command |
00000a00  73 74 72 69 6e 67 0d 20  20 20 20 20 20 20 20 45  |string.        E|
00000a10  51 55 42 20 75 66 6f 20  44 49 56 20 32 35 36 20  |QUB ufo DIV 256 |
00000a20  20 20 5c 20 65 6e 64 20  6f 66 20 63 6f 6d 6d 61  |  \ end of comma|
00000a30  6e 64 20 6d 61 72 6b 65  72 20 26 20 6d 73 20 62  |nd marker & ms b|
00000a40  79 74 65 0d 20 20 20 20  20 20 20 20 45 51 55 42  |yte.        EQUB|
00000a50  20 75 66 6f 20 4d 4f 44  20 32 35 36 20 20 20 5c  | ufo MOD 256   \|
00000a60  20 6c 73 20 62 79 74 65  0d 20 20 20 20 20 20 20  | ls byte.       |
00000a70  20 45 51 55 42 20 26 46  46 20 20 20 20 20 20 20  | EQUB &FF       |
00000a80  20 20 20 20 5c 20 74 65  72 6d 69 6e 61 74 69 6f  |    \ terminatio|
00000a90  6e 20 63 68 61 72 61 63  74 65 72 0d 0d 46 69 67  |n character..Fig|
00000aa0  75 72 65 20 31 35 2e 31  20 20 54 68 65 20 6e 65  |ure 15.1  The ne|
00000ab0  77 20 63 6f 6d 6d 61 6e  64 20 74 61 62 6c 65 2e  |w command table.|
00000ac0  0d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 20 20 2d 2d  |.-----------  --|
00000ad0  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000ae0  2d 2d 2d 2d 0d 0d 0d 0d  0d 20 20 54 68 65 20 69  |----.....  The i|
00000af0  6e 74 65 72 70 72 65 74  65 72 20 69 6e 74 65 72  |nterpreter inter|
00000b00  63 65 70 74 73 20 73 65  72 76 69 63 65 20 63 61  |cepts service ca|
00000b10  6c 6c 20 34 20 61 6e 64  20 74 68 65 6e 20 63 6f  |ll 4 and then co|
00000b20  6d 70 61 72 65 73 20 74  68 65 0d 75 6e 72 65 63  |mpares the.unrec|
00000b30  6f 67 6e 69 73 65 64 20  63 6f 6d 6d 61 6e 64 20  |ognised command |
00000b40  77 69 74 68 20 65 61 63  68 20 63 6f 6d 6d 61 6e  |with each comman|
00000b50  64 20 69 6e 20 74 68 65  20 63 6f 6d 6d 61 6e 64  |d in the command|
00000b60  20 74 61 62 6c 65 2e 20  49 66 20 61 0d 6d 61 74  | table. If a.mat|
00000b70  63 68 20 69 73 20 66 6f  75 6e 64 20 74 68 65 20  |ch is found the |
00000b80  63 6f 6d 6d 61 6e 64 20  61 64 64 72 65 73 73 20  |command address |
00000b90  69 73 20 74 61 6b 65 6e  20 66 72 6f 6d 20 74 68  |is taken from th|
00000ba0  65 20 63 6f 6d 6d 61 6e  64 20 74 61 62 6c 65 20  |e command table |
00000bb0  61 6e 64 0d 73 74 6f 72  65 64 20 69 6e 20 74 77  |and.stored in tw|
00000bc0  6f 20 63 6f 6e 73 65 63  75 74 69 76 65 20 7a 65  |o consecutive ze|
00000bd0  72 6f 20 70 61 67 65 20  62 79 74 65 73 20 77 68  |ro page bytes wh|
00000be0  69 63 68 20 61 72 65 20  75 73 65 64 20 74 6f 20  |ich are used to |
00000bf0  6d 61 6b 65 20 61 6e 0d  69 6e 64 69 72 65 63 74  |make an.indirect|
00000c00  20 6a 75 6d 70 20 74 6f  20 74 68 65 20 6e 65 77  | jump to the new|
00000c10  20 72 6f 75 74 69 6e 65  2e 0d 0d 20 20 54 68 65  | routine...  The|
00000c20  20 6f 72 64 65 72 20 6f  66 20 74 68 65 20 63 6f  | order of the co|
00000c30  6d 6d 61 6e 64 73 20 69  6e 20 74 68 65 20 74 61  |mmands in the ta|
00000c40  62 6c 65 20 69 73 20 76  65 72 79 20 69 6d 70 6f  |ble is very impo|
00000c50  72 74 61 6e 74 2e 20 54  68 65 0d 6c 6f 6e 67 65  |rtant. The.longe|
00000c60  73 74 20 63 6f 6d 6d 61  6e 64 20 6e 61 6d 65 20  |st command name |
00000c70  6d 75 73 74 20 62 65 20  61 74 20 74 68 65 20 68  |must be at the h|
00000c80  65 61 64 20 6f 66 20 74  68 65 20 74 61 62 6c 65  |ead of the table|
00000c90  20 61 6e 64 20 74 68 65  20 73 68 6f 72 74 65 73  | and the shortes|
00000ca0  74 0d 61 74 20 74 68 65  20 65 6e 64 2e 20 54 68  |t.at the end. Th|
00000cb0  65 20 72 65 61 73 6f 6e  20 66 6f 72 20 74 68 69  |e reason for thi|
00000cc0  73 20 69 73 20 74 68 61  74 20 69 66 20 74 77 6f  |s is that if two|
00000cd0  20 63 6f 6d 6d 61 6e 64  73 20 73 75 63 68 20 61  | commands such a|
00000ce0  73 20 2a 52 45 44 0d 61  6e 64 20 2a 52 45 44 55  |s *RED.and *REDU|
00000cf0  43 45 20 61 72 65 20 69  6e 63 6c 75 64 65 64 20  |CE are included |
00000d00  69 6e 20 74 68 65 20 74  61 62 6c 65 20 61 6e 64  |in the table and|
00000d10  20 74 68 65 20 75 6e 72  65 63 6f 67 6e 69 73 65  | the unrecognise|
00000d20  64 20 63 6f 6d 6d 61 6e  64 20 69 73 0d 63 6f 6d  |d command is.com|
00000d30  70 61 72 65 64 20 77 69  74 68 20 52 45 44 20 62  |pared with RED b|
00000d40  65 66 6f 72 65 20 52 45  44 55 43 45 20 74 68 65  |efore REDUCE the|
00000d50  6e 20 2a 52 45 44 55 43  45 20 77 69 6c 6c 20 62  |n *REDUCE will b|
00000d60  65 20 72 65 63 6f 67 6e  69 73 65 64 20 61 73 0d  |e recognised as.|
00000d70  2a 52 45 44 20 77 69 74  68 20 74 68 65 20 61 72  |*RED with the ar|
00000d80  67 75 6d 65 6e 74 20 22  55 43 45 22 2e 20 54 68  |gument "UCE". Th|
00000d90  65 20 63 6f 6d 6d 61 6e  64 73 20 69 6e 20 74 68  |e commands in th|
00000da0  65 20 74 61 62 6c 65 20  6d 75 73 74 20 61 6c 6c  |e table must all|
00000db0  20 62 65 0d 75 70 70 65  72 20 63 61 73 65 20 61  | be.upper case a|
00000dc0  6c 70 68 61 62 65 74 69  63 20 63 68 61 72 61 63  |lphabetic charac|
00000dd0  74 65 72 73 20 61 6e 64  20 6d 75 73 74 20 6e 6f  |ters and must no|
00000de0  74 20 73 74 61 72 74 20  77 69 74 68 20 74 68 65  |t start with the|
00000df0  20 6f 70 74 69 6f 6e 61  6c 0d 63 68 61 72 61 63  | optional.charac|
00000e00  74 65 72 2c 20 69 6e 20  74 68 69 73 20 65 78 61  |ter, in this exa|
00000e10  6d 70 6c 65 20 22 58 22  2e 20 4e 75 6d 62 65 72  |mple "X". Number|
00000e20  73 20 61 6e 64 20 70 75  6e 63 74 75 61 74 69 6f  |s and punctuatio|
00000e30  6e 20 63 68 61 72 61 63  74 65 72 73 0d 6d 75 73  |n characters.mus|
00000e40  74 20 6e 6f 74 20 62 65  20 75 73 65 64 20 62 65  |t not be used be|
00000e50  63 61 75 73 65 20 74 68  65 20 75 6e 72 65 63 6f  |cause the unreco|
00000e60  67 6e 69 73 65 64 20 63  6f 6d 6d 61 6e 64 20 69  |gnised command i|
00000e70  73 20 66 6f 72 63 65 64  20 74 6f 20 75 70 70 65  |s forced to uppe|
00000e80  72 0d 63 61 73 65 20 62  79 20 41 4e 44 69 6e 67  |r.case by ANDing|
00000e90  20 69 74 20 77 69 74 68  20 23 26 44 46 2e 0d 0d  | it with #&DF...|
00000ea0  20 20 54 68 65 20 74 68  72 65 65 20 6e 65 77 20  |  The three new |
00000eb0  72 6f 75 74 69 6e 65 73  20 69 6e 20 74 68 65 20  |routines in the |
00000ec0  65 78 61 6d 70 6c 65 20  70 72 6f 67 72 61 6d 20  |example program |
00000ed0  53 4f 55 4e 44 53 20 61  72 65 20 63 61 6c 6c 65  |SOUNDS are calle|
00000ee0  64 20 77 69 74 68 0d 2a  53 49 52 45 4e 2c 20 2a  |d with.*SIREN, *|
00000ef0  48 45 48 45 2c 20 61 6e  64 20 2a 55 46 4f 2e 20  |HEHE, and *UFO. |
00000f00  41 6c 6c 20 74 68 72 65  65 20 72 6f 75 74 69 6e  |All three routin|
00000f10  65 73 20 61 72 65 20 74  68 65 20 6d 61 63 68 69  |es are the machi|
00000f20  6e 65 20 63 6f 64 65 0d  65 71 75 69 76 61 6c 65  |ne code.equivale|
00000f30  6e 74 20 6f 66 20 74 68  65 20 45 4e 56 45 4c 4f  |nt of the ENVELO|
00000f40  50 45 20 61 6e 64 20 53  4f 55 4e 44 20 63 6f 6d  |PE and SOUND com|
00000f50  6d 61 6e 64 73 20 73 75  67 67 65 73 74 65 64 20  |mands suggested |
00000f60  62 79 20 74 68 65 69 72  0d 6e 61 6d 65 73 2e 0d  |by their.names..|
00000f70  0d 20 20 4c 6f 61 64 20  74 68 65 20 6f 62 6a 65  |.  Load the obje|
00000f80  63 74 20 63 6f 64 65 20  67 65 6e 65 72 61 74 65  |ct code generate|
00000f90  64 20 62 79 20 53 4f 55  4e 44 53 20 69 6e 74 6f  |d by SOUNDS into|
00000fa0  20 53 57 52 20 61 6e 64  20 70 72 65 73 73 20 74  | SWR and press t|
00000fb0  68 65 0d 42 72 65 61 6b  20 6b 65 79 2e 20 54 68  |he.Break key. Th|
00000fc0  65 20 63 6f 6d 6d 61 6e  64 20 2a 48 45 48 45 20  |e command *HEHE |
00000fd0  63 61 6e 20 62 65 20 73  68 6f 72 74 65 6e 65 64  |can be shortened|
00000fe0  20 74 6f 20 74 68 72 65  65 20 63 68 61 72 61 63  | to three charac|
00000ff0  74 65 72 73 0d 28 2a 48  45 48 2e 29 20 62 75 74  |ters.(*HEH.) but|
00001000  20 69 66 20 69 74 20 69  73 20 73 68 6f 72 74 65  | if it is shorte|
00001010  6e 65 64 20 66 75 72 74  68 65 72 20 28 2a 48 45  |ned further (*HE|
00001020  2e 29 20 74 68 65 20 63  6f 6d 6d 61 6e 64 20 63  |.) the command c|
00001030  6c 61 73 68 65 73 20 77  69 74 68 0d 74 68 65 20  |lashes with.the |
00001040  2a 48 45 4c 50 20 63 6f  6d 6d 61 6e 64 2e 20 54  |*HELP command. T|
00001050  68 65 20 6f 70 74 69 6f  6e 61 6c 20 70 72 65 66  |he optional pref|
00001060  69 78 20 68 61 73 20 74  6f 20 62 65 20 75 73 65  |ix has to be use|
00001070  64 20 28 2a 58 48 2e 29  20 69 66 20 79 6f 75 0d  |d (*XH.) if you.|
00001080  77 61 6e 74 20 74 6f 20  73 68 6f 72 74 65 6e 20  |want to shorten |
00001090  74 68 65 20 63 6f 6d 6d  61 6e 64 20 74 6f 20 74  |the command to t|
000010a0  77 6f 20 63 68 61 72 61  63 74 65 72 73 2e 0d 0d  |wo characters...|
000010b0  20 20 54 68 65 20 6d 75  6c 74 69 70 6c 65 20 63  |  The multiple c|
000010c0  6f 6d 6d 61 6e 64 20 69  6e 74 65 72 70 72 65 74  |ommand interpret|
000010d0  65 72 20 69 6e 74 65 72  63 65 70 74 73 20 73 65  |er intercepts se|
000010e0  72 76 69 63 65 20 63 61  6c 6c 20 34 20 28 6c 69  |rvice call 4 (li|
000010f0  6e 65 73 0d 32 38 30 2d  33 31 30 29 20 61 6e 64  |nes.280-310) and|
00001100  20 70 75 73 68 65 73 20  74 68 65 20 72 65 67 69  | pushes the regi|
00001110  73 74 65 72 73 20 28 6c  69 6e 65 73 20 33 32 30  |sters (lines 320|
00001120  2d 33 36 30 29 20 61 6e  64 20 74 77 6f 20 7a 65  |-360) and two ze|
00001130  72 6f 20 70 61 67 65 0d  62 79 74 65 73 20 28 6c  |ro page.bytes (l|
00001140  69 6e 65 73 20 33 37 30  2d 34 30 30 29 20 6f 6e  |ines 370-400) on|
00001150  20 74 68 65 20 73 74 61  63 6b 2e 0d 0d 20 20 54  | the stack...  T|
00001160  68 65 20 58 20 72 65 67  69 73 74 65 72 20 69 73  |he X register is|
00001170  20 75 73 65 64 20 61 73  20 61 6e 20 6f 66 66 73  | used as an offs|
00001180  65 74 20 6f 6e 20 74 68  65 20 63 6f 6d 6d 61 6e  |et on the comman|
00001190  64 20 74 61 62 6c 65 20  61 64 64 72 65 73 73 20  |d table address |
000011a0  61 6e 64 0d 69 74 20 69  73 20 69 6e 69 74 69 61  |and.it is initia|
000011b0  6c 69 73 65 64 20 77 69  74 68 20 74 68 65 20 76  |lised with the v|
000011c0  61 6c 75 65 20 6f 66 20  26 46 45 20 28 6c 69 6e  |alue of &FE (lin|
000011d0  65 20 34 31 30 29 2e 20  54 68 65 20 72 65 61 73  |e 410). The reas|
000011e0  6f 6e 20 77 68 79 20 58  0d 69 73 20 69 6e 69 74  |on why X.is init|
000011f0  69 61 6c 69 73 65 64 20  74 6f 20 26 46 45 2c 20  |ialised to &FE, |
00001200  61 6e 64 20 6e 6f 74 20  7a 65 72 6f 20 61 73 20  |and not zero as |
00001210  79 6f 75 20 6d 69 67 68  74 20 65 78 70 65 63 74  |you might expect|
00001220  2c 20 69 73 20 74 68 61  74 20 69 74 20 69 73 0d  |, is that it is.|
00001230  69 6e 63 72 65 6d 65 6e  74 65 64 20 69 6e 20 74  |incremented in t|
00001240  68 65 20 6f 75 74 65 72  20 6c 6f 6f 70 20 6f 66  |he outer loop of|
00001250  20 74 68 65 20 63 6f 6d  70 61 72 69 73 6f 6e 20  | the comparison |
00001260  72 6f 75 74 69 6e 65 20  28 6c 69 6e 65 20 34 35  |routine (line 45|
00001270  30 29 20 74 6f 0d 70 6f  69 6e 74 20 74 6f 20 74  |0) to.point to t|
00001280  68 65 20 62 79 74 65 20  62 65 66 6f 72 65 20 74  |he byte before t|
00001290  68 65 20 66 69 72 73 74  20 62 79 74 65 20 6f 66  |he first byte of|
000012a0  20 65 61 63 68 20 63 6f  6d 6d 61 6e 64 20 69 6e  | each command in|
000012b0  20 74 68 65 20 74 61 62  6c 65 0d 61 6e 64 20 61  | the table.and a|
000012c0  67 61 69 6e 20 69 6e 20  74 68 65 20 69 6e 6e 65  |gain in the inne|
000012d0  72 20 6c 6f 6f 70 20 28  6c 69 6e 65 20 35 35 30  |r loop (line 550|
000012e0  29 20 74 6f 20 70 6f 69  6e 74 20 74 6f 20 65 76  |) to point to ev|
000012f0  65 72 79 20 62 79 74 65  20 6f 66 20 65 61 63 68  |ery byte of each|
00001300  0d 63 6f 6d 6d 61 6e 64  20 73 74 61 72 74 69 6e  |.command startin|
00001310  67 20 77 69 74 68 20 74  68 65 20 66 69 72 73 74  |g with the first|
00001320  20 62 79 74 65 2e 20 54  68 65 20 59 20 72 65 67  | byte. The Y reg|
00001330  69 73 74 65 72 20 69 73  20 74 68 65 20 6f 66 66  |ister is the off|
00001340  73 65 74 20 6f 6e 0d 74  68 65 20 75 6e 72 65 63  |set on.the unrec|
00001350  6f 67 6e 69 73 65 64 20  63 6f 6d 6d 61 6e 64 20  |ognised command |
00001360  74 65 78 74 20 70 6f 69  6e 74 65 72 20 61 6e 64  |text pointer and|
00001370  20 6e 65 65 64 73 20 74  6f 20 62 65 20 72 65 73  | needs to be res|
00001380  74 6f 72 65 64 20 74 6f  20 69 74 73 0d 69 6e 69  |tored to its.ini|
00001390  74 69 61 6c 20 76 61 6c  75 65 20 61 74 20 74 68  |tial value at th|
000013a0  65 20 62 65 67 69 6e 69  6e 67 20 6f 66 20 65 61  |e begining of ea|
000013b0  63 68 20 63 6f 6d 70 61  72 69 73 6f 6e 2e 20 49  |ch comparison. I|
000013c0  74 20 69 73 20 70 75 73  68 65 64 20 6f 6e 20 74  |t is pushed on t|
000013d0  68 65 0d 73 74 61 63 6b  20 61 73 20 61 20 74 65  |he.stack as a te|
000013e0  6d 70 6f 72 61 72 79 20  73 74 6f 72 65 20 28 6c  |mporary store (l|
000013f0  69 6e 65 73 20 34 31 30  2d 34 32 30 29 2e 0d 0d  |ines 410-420)...|
00001400  20 20 54 68 65 20 6f 75  74 65 72 20 6c 6f 6f 70  |  The outer loop|
00001410  20 6f 66 20 74 68 65 20  63 6f 6d 70 61 72 69 73  | of the comparis|
00001420  6f 6e 20 72 6f 75 74 69  6e 65 20 69 73 20 69 6e  |on routine is in|
00001430  20 6c 69 6e 65 73 20 34  35 30 20 74 6f 20 37 30  | lines 450 to 70|
00001440  30 2e 20 54 68 65 0d 6f  75 74 65 72 20 6c 6f 6f  |0. The.outer loo|
00001450  70 20 70 6f 69 6e 74 73  20 74 6f 20 65 61 63 68  |p points to each|
00001460  20 63 6f 6d 6d 61 6e 64  20 69 6e 20 74 68 65 20  | command in the |
00001470  63 6f 6d 6d 61 6e 64 20  74 61 62 6c 65 2e 20 54  |command table. T|
00001480  68 65 20 58 20 72 65 67  69 73 74 65 72 0d 69 73  |he X register.is|
00001490  20 69 6e 63 72 65 6d 65  6e 74 65 64 20 74 6f 20  | incremented to |
000014a0  70 6f 69 6e 74 20 74 6f  20 74 68 65 20 62 79 74  |point to the byt|
000014b0  65 20 70 72 65 63 65 64  69 6e 67 20 74 68 65 20  |e preceding the |
000014c0  66 69 72 73 74 20 62 79  74 65 20 6f 66 20 65 61  |first byte of ea|
000014d0  63 68 0d 63 6f 6d 6d 61  6e 64 20 28 6c 69 6e 65  |ch.command (line|
000014e0  20 34 35 30 29 20 61 6e  64 20 74 68 65 20 59 20  | 450) and the Y |
000014f0  72 65 67 69 73 74 65 72  20 69 73 20 72 65 73 74  |register is rest|
00001500  6f 72 65 64 20 74 6f 20  69 74 73 20 69 6e 69 74  |ored to its init|
00001510  69 61 6c 20 76 61 6c 75  65 0d 28 6c 69 6e 65 73  |ial value.(lines|
00001520  20 34 36 30 2d 34 38 30  29 2e 20 54 68 65 20 66  | 460-480). The f|
00001530  69 72 73 74 20 63 68 61  72 61 63 74 65 72 20 6f  |irst character o|
00001540  66 20 74 68 65 20 75 6e  72 65 63 6f 67 6e 69 73  |f the unrecognis|
00001550  65 64 20 63 6f 6d 6d 61  6e 64 20 69 73 0d 72 65  |ed command is.re|
00001560  61 64 20 28 6c 69 6e 65  20 34 39 30 29 20 61 6e  |ad (line 490) an|
00001570  64 20 66 6f 72 63 65 64  20 74 6f 20 75 70 70 65  |d forced to uppe|
00001580  72 20 63 61 73 65 20 28  6c 69 6e 65 20 35 30 30  |r case (line 500|
00001590  29 2e 20 49 74 20 69 73  20 63 6f 6d 70 61 72 65  |). It is compare|
000015a0  64 0d 77 69 74 68 20 74  68 65 20 6f 70 74 69 6f  |d.with the optio|
000015b0  6e 61 6c 20 66 69 72 73  74 20 63 68 61 72 61 63  |nal first charac|
000015c0  74 65 72 20 28 6c 69 6e  65 20 35 31 30 29 20 61  |ter (line 510) a|
000015d0  6e 64 20 69 66 20 69 74  20 6d 61 74 63 68 65 73  |nd if it matches|
000015e0  20 74 68 65 20 59 0d 72  65 67 69 73 74 65 72 20  | the Y.register |
000015f0  69 73 20 69 6e 63 72 65  6d 65 6e 74 65 64 20 74  |is incremented t|
00001600  6f 20 70 6f 69 6e 74 20  74 6f 20 74 68 65 20 6e  |o point to the n|
00001610  65 78 74 20 63 68 61 72  61 63 74 65 72 20 28 6c  |ext character (l|
00001620  69 6e 65 20 35 33 30 29  2e 20 49 66 0d 69 74 20  |ine 530). If.it |
00001630  64 6f 65 73 20 6e 6f 74  20 6d 61 74 63 68 20 74  |does not match t|
00001640  68 65 20 59 20 72 65 67  69 73 74 65 72 20 69 73  |he Y register is|
00001650  20 6e 6f 74 20 69 6e 63  72 65 6d 65 6e 74 65 64  | not incremented|
00001660  20 73 6f 20 74 68 61 74  20 74 68 65 20 66 69 72  | so that the fir|
00001670  73 74 0d 63 68 61 72 61  63 74 65 72 20 77 69 6c  |st.character wil|
00001680  6c 20 62 65 20 72 65 61  64 20 61 67 61 69 6e 20  |l be read again |
00001690  61 6e 64 20 63 6f 6d 70  61 72 65 64 20 77 69 74  |and compared wit|
000016a0  68 20 74 68 65 20 63 6f  6e 74 65 6e 74 73 20 6f  |h the contents o|
000016b0  66 20 74 68 65 0d 63 6f  6d 6d 61 6e 64 20 74 61  |f the.command ta|
000016c0  62 6c 65 2e 0d 0d 20 20  54 68 65 20 69 6e 6e 65  |ble...  The inne|
000016d0  72 20 6c 6f 6f 70 20 6f  66 20 74 68 65 20 63 6f  |r loop of the co|
000016e0  6d 70 61 72 69 73 6f 6e  20 72 6f 75 74 69 6e 65  |mparison routine|
000016f0  20 69 73 20 69 6e 20 6c  69 6e 65 73 20 35 35 30  | is in lines 550|
00001700  20 74 6f 20 36 34 30 2e  0d 54 68 69 73 20 6c 6f  | to 640..This lo|
00001710  6f 70 20 63 6f 6d 70 61  72 65 73 20 65 76 65 72  |op compares ever|
00001720  79 20 62 79 74 65 20 6f  66 20 65 61 63 68 20 6e  |y byte of each n|
00001730  65 77 20 63 6f 6d 6d 61  6e 64 20 77 69 74 68 20  |ew command with |
00001740  65 76 65 72 79 20 62 79  74 65 20 6f 66 0d 74 68  |every byte of.th|
00001750  65 20 75 6e 72 65 63 6f  67 6e 69 73 65 64 20 63  |e unrecognised c|
00001760  6f 6d 6d 61 6e 64 20 61  6e 64 20 72 65 63 6f 67  |ommand and recog|
00001770  6e 69 73 65 73 20 61 20  63 6f 6d 6d 61 6e 64 20  |nises a command |
00001780  69 66 20 65 69 74 68 65  72 20 61 6c 6c 20 74 68  |if either all th|
00001790  65 0d 70 61 69 72 73 20  6f 66 20 62 79 74 65 73  |e.pairs of bytes|
000017a0  20 6d 61 74 63 68 20 6f  72 20 69 66 20 61 6c 6c  | match or if all|
000017b0  20 70 61 69 72 73 20 6f  66 20 62 79 74 65 73 20  | pairs of bytes |
000017c0  6d 61 74 63 68 20 75 6e  74 69 6c 20 61 20 64 6f  |match until a do|
000017d0  74 20 69 73 0d 72 65 61  64 20 61 74 20 74 68 65  |t is.read at the|
000017e0  20 65 6e 64 20 6f 66 20  74 68 65 20 75 6e 72 65  | end of the unre|
000017f0  63 6f 67 6e 69 73 65 64  20 63 6f 6d 6d 61 6e 64  |cognised command|
00001800  2e 0d 0d 20 20 54 68 65  20 58 20 72 65 67 69 73  |...  The X regis|
00001810  74 65 72 20 69 73 20 69  6e 63 72 65 6d 65 6e 74  |ter is increment|
00001820  65 64 20 28 6c 69 6e 65  20 35 35 30 29 20 74 6f  |ed (line 550) to|
00001830  20 70 6f 69 6e 74 20 74  6f 20 74 68 65 20 66 69  | point to the fi|
00001840  72 73 74 20 62 79 74 65  0d 6f 66 20 61 20 63 6f  |rst byte.of a co|
00001850  6d 6d 61 6e 64 20 69 6e  20 74 68 65 20 63 6f 6d  |mmand in the com|
00001860  6d 61 6e 64 20 74 61 62  6c 65 2e 20 54 68 65 20  |mand table. The |
00001870  62 79 74 65 20 70 6f 69  6e 74 65 64 20 74 6f 20  |byte pointed to |
00001880  62 79 20 74 68 65 20 6f  66 66 73 65 74 0d 69 6e  |by the offset.in|
00001890  20 58 20 69 73 20 72 65  61 64 20 28 6c 69 6e 65  | X is read (line|
000018a0  20 35 36 30 29 20 61 6e  64 20 74 65 73 74 65 64  | 560) and tested|
000018b0  20 28 6c 69 6e 65 20 35  37 30 29 20 74 6f 20 73  | (line 570) to s|
000018c0  65 65 20 69 66 20 69 74  20 69 73 20 74 68 65 20  |ee if it is the |
000018d0  65 6e 64 0d 6f 66 20 63  6f 6d 6d 61 6e 64 20 6d  |end.of command m|
000018e0  61 72 6b 65 72 20 28 74  68 65 20 6d 6f 73 74 20  |arker (the most |
000018f0  73 69 67 6e 69 66 69 63  61 6e 74 20 62 79 74 65  |significant byte|
00001900  20 6f 66 20 74 68 65 20  61 64 64 72 65 73 73 20  | of the address |
00001910  62 79 74 65 73 29 2e 0d  57 68 65 6e 20 74 68 65  |bytes)..When the|
00001920  20 63 6f 6d 6d 61 6e 64  20 6e 61 6d 65 20 61 6e  | command name an|
00001930  64 20 75 6e 72 65 63 6f  67 6e 69 73 65 64 20 63  |d unrecognised c|
00001940  6f 6d 6d 61 6e 64 20 6d  61 74 63 68 20 74 68 65  |ommand match the|
00001950  20 65 6e 64 20 6f 66 0d  63 6f 6d 6d 61 6e 64 20  | end of.command |
00001960  6d 61 72 6b 65 72 20 77  69 6c 6c 20 62 65 20 72  |marker will be r|
00001970  65 61 64 20 61 6e 64 20  63 6f 6e 74 72 6f 6c 20  |ead and control |
00001980  69 73 20 70 61 73 73 65  64 20 74 6f 20 74 68 65  |is passed to the|
00001990  20 6c 61 62 65 6c 0d 22  2e 66 6f 75 6e 64 22 2e  | label.".found".|
000019a0  20 43 6f 6e 74 72 6f 6c  20 69 73 20 61 6c 73 6f  | Control is also|
000019b0  20 70 61 73 73 65 64 20  74 6f 20 22 2e 66 6f 75  | passed to ".fou|
000019c0  6e 64 22 20 77 68 65 6e  20 74 68 65 20 74 65 72  |nd" when the ter|
000019d0  6d 69 6e 61 74 69 6f 6e  0d 63 68 61 72 61 63 74  |mination.charact|
000019e0  65 72 20 28 26 46 46 29  20 69 73 20 72 65 61 64  |er (&FF) is read|
000019f0  2e 20 49 66 20 74 68 65  20 65 6e 64 20 6f 66 20  |. If the end of |
00001a00  63 6f 6d 6d 61 6e 64 20  6d 61 72 6b 65 72 20 6f  |command marker o|
00001a10  72 20 74 65 72 6d 69 6e  61 74 69 6f 6e 0d 63 68  |r termination.ch|
00001a20  61 72 61 63 74 65 72 20  69 73 20 6e 6f 74 20 72  |aracter is not r|
00001a30  65 61 64 20 74 68 65 20  6e 65 78 74 20 62 79 74  |ead the next byt|
00001a40  65 20 69 6e 20 74 68 65  20 75 6e 72 65 63 6f 67  |e in the unrecog|
00001a50  6e 69 73 65 64 20 63 6f  6d 6d 61 6e 64 20 69 73  |nised command is|
00001a60  0d 63 6f 6d 70 61 72 65  64 20 77 69 74 68 20 22  |.compared with "|
00001a70  2e 22 20 28 6c 69 6e 65  73 20 35 38 30 2d 36 30  |." (lines 580-60|
00001a80  30 29 2e 20 49 66 20 74  68 65 20 6e 65 78 74 20  |0). If the next |
00001a90  63 68 61 72 61 63 74 65  72 20 69 73 20 61 20 64  |character is a d|
00001aa0  6f 74 0d 63 6f 6e 74 72  6f 6c 20 69 73 20 70 61  |ot.control is pa|
00001ab0  73 73 65 64 20 74 6f 20  74 68 65 20 6c 61 62 65  |ssed to the labe|
00001ac0  6c 20 22 2e 66 6f 75 6e  64 6f 74 22 2e 0d 0d 20  |l ".foundot"... |
00001ad0  20 54 68 65 20 69 6e 6e  65 72 20 6c 6f 6f 70 20  | The inner loop |
00001ae0  69 6e 20 6c 69 6e 65 73  20 35 35 30 20 74 6f 20  |in lines 550 to |
00001af0  36 34 30 20 65 78 69 74  73 20 77 68 65 6e 20 61  |640 exits when a|
00001b00  20 6d 69 73 6d 61 74 63  68 20 69 6e 20 74 68 65  | mismatch in the|
00001b10  0d 70 61 69 72 73 20 6f  66 20 62 79 74 65 73 20  |.pairs of bytes |
00001b20  69 73 20 66 6f 75 6e 64  2e 20 57 68 65 6e 20 61  |is found. When a|
00001b30  20 6d 69 73 6d 61 74 63  68 20 6f 63 63 75 72 73  | mismatch occurs|
00001b40  20 74 68 65 20 58 20 72  65 67 69 73 74 65 72 20  | the X register |
00001b50  69 73 0d 70 6f 69 6e 74  65 64 20 74 6f 20 74 68  |is.pointed to th|
00001b60  65 20 65 6e 64 20 6f 66  20 63 6f 6d 6d 61 6e 64  |e end of command|
00001b70  20 6d 61 72 6b 65 72 20  28 6c 69 6e 65 73 20 36  | marker (lines 6|
00001b80  36 30 2d 36 38 30 29 20  61 6e 64 20 74 68 65 20  |60-680) and the |
00001b90  6d 61 72 6b 65 72 20 69  73 0d 63 6f 6d 70 61 72  |marker is.compar|
00001ba0  65 64 20 77 69 74 68 20  26 46 46 20 74 6f 20 73  |ed with &FF to s|
00001bb0  65 65 20 69 66 20 69 74  20 69 73 20 74 68 65 20  |ee if it is the |
00001bc0  63 6f 6d 6d 61 6e 64 20  74 61 62 6c 65 20 74 65  |command table te|
00001bd0  72 6d 69 6e 61 74 69 6f  6e 0d 63 68 61 72 61 63  |rmination.charac|
00001be0  74 65 72 20 28 6c 69 6e  65 20 36 39 30 29 2e 20  |ter (line 690). |
00001bf0  49 66 20 74 68 65 20 74  65 72 6d 69 6e 61 74 69  |If the terminati|
00001c00  6f 6e 20 63 68 61 72 61  63 74 65 72 20 69 73 20  |on character is |
00001c10  66 6f 75 6e 64 20 74 68  65 20 7a 65 72 6f 0d 70  |found the zero.p|
00001c20  61 67 65 20 62 79 74 65  73 20 61 6e 64 20 72 65  |age bytes and re|
00001c30  67 69 73 74 65 72 73 20  61 72 65 20 72 65 73 74  |gisters are rest|
00001c40  6f 72 65 64 20 61 6e 64  20 63 6f 6e 74 72 6f 6c  |ored and control|
00001c50  20 69 73 20 70 61 73 73  65 64 20 62 61 63 6b 20  | is passed back |
00001c60  74 6f 0d 74 68 65 20 4d  4f 53 20 28 6c 69 6e 65  |to.the MOS (line|
00001c70  73 20 37 32 30 2d 38 32  30 29 2e 20 49 66 20 69  |s 720-820). If i|
00001c80  74 20 69 73 20 6e 6f 74  20 74 68 65 20 72 6f 75  |t is not the rou|
00001c90  74 69 6e 65 20 62 72 61  6e 63 68 65 73 20 62 61  |tine branches ba|
00001ca0  63 6b 20 74 6f 20 74 68  65 0d 6c 61 62 65 6c 20  |ck to the.label |
00001cb0  22 2e 66 69 72 73 74 63  68 61 72 22 20 28 6c 69  |".firstchar" (li|
00001cc0  6e 65 20 34 34 30 29 20  74 6f 20 63 6f 6d 70 61  |ne 440) to compa|
00001cd0  72 65 20 74 68 65 20 75  6e 72 65 63 6f 67 6e 69  |re the unrecogni|
00001ce0  73 65 64 20 63 6f 6d 6d  61 6e 64 20 77 69 74 68  |sed command with|
00001cf0  0d 74 68 65 20 6e 65 78  74 20 63 6f 6d 6d 61 6e  |.the next comman|
00001d00  64 20 69 6e 20 74 68 65  20 74 61 62 6c 65 2e 0d  |d in the table..|
00001d10  0d 20 20 57 68 65 6e 20  61 20 63 6f 6d 6d 61 6e  |.  When a comman|
00001d20  64 20 73 68 6f 72 74 65  6e 65 64 20 77 69 74 68  |d shortened with|
00001d30  20 61 20 64 6f 74 20 69  73 20 72 65 63 6f 67 6e  | a dot is recogn|
00001d40  69 73 65 64 20 63 6f 6e  74 72 6f 6c 20 69 73 20  |ised control is |
00001d50  70 61 73 73 65 64 0d 74  6f 20 74 68 65 20 6c 61  |passed.to the la|
00001d60  62 65 6c 20 22 2e 66 6f  75 6e 64 6f 74 22 20 28  |bel ".foundot" (|
00001d70  6c 69 6e 65 20 38 33 30  29 2e 20 54 68 65 20 58  |line 830). The X|
00001d80  20 72 65 67 69 73 74 65  72 20 69 73 20 74 68 65  | register is the|
00001d90  6e 20 69 6e 63 72 65 6d  65 6e 74 65 64 0d 75 6e  |n incremented.un|
00001da0  74 69 6c 20 69 74 20 70  6f 69 6e 74 73 20 74 6f  |til it points to|
00001db0  20 74 68 65 20 65 6e 64  20 6f 66 20 63 6f 6d 6d  | the end of comm|
00001dc0  61 6e 64 20 6d 61 72 6b  65 72 20 28 6c 69 6e 65  |and marker (line|
00001dd0  73 20 38 34 30 2d 38 36  30 29 2e 0d 0d 20 20 41  |s 840-860)...  A|
00001de0  6e 20 75 6e 73 68 6f 72  74 65 6e 65 64 20 63 6f  |n unshortened co|
00001df0  6d 6d 61 6e 64 20 70 61  73 73 65 73 20 63 6f 6e  |mmand passes con|
00001e00  74 72 6f 6c 20 74 6f 20  74 68 65 20 6c 61 62 65  |trol to the labe|
00001e10  6c 20 22 2e 66 6f 75 6e  64 22 20 28 6c 69 6e 65  |l ".found" (line|
00001e20  0d 38 37 30 29 2e 20 54  68 65 20 61 63 63 75 6d  |.870). The accum|
00001e30  75 6c 61 74 6f 72 20 69  73 20 63 6f 6d 70 61 72  |ulator is compar|
00001e40  65 64 20 77 69 74 68 20  26 46 46 20 74 6f 20 73  |ed with &FF to s|
00001e50  65 65 20 69 66 20 74 68  65 20 74 65 72 6d 69 6e  |ee if the termin|
00001e60  61 74 69 6f 6e 0d 63 68  61 72 61 63 74 65 72 20  |ation.character |
00001e70  68 61 73 20 62 65 65 6e  20 72 65 61 64 2e 20 49  |has been read. I|
00001e80  66 20 69 74 20 68 61 73  20 74 68 65 6e 20 6e 6f  |f it has then no|
00001e90  6e 65 20 6f 66 20 74 68  65 20 63 6f 6d 6d 61 6e  |ne of the comman|
00001ea0  64 73 20 6d 61 74 63 68  20 74 68 65 0d 75 6e 72  |ds match the.unr|
00001eb0  65 63 6f 67 6e 69 73 65  64 20 63 6f 6d 6d 61 6e  |ecognised comman|
00001ec0  64 20 61 6e 64 20 73 6f  20 74 68 65 20 72 65 67  |d and so the reg|
00001ed0  69 73 74 65 72 73 20 61  72 65 20 72 65 73 74 6f  |isters are resto|
00001ee0  72 65 64 20 61 6e 64 20  63 6f 6e 74 72 6f 6c 0d  |red and control.|
00001ef0  70 61 73 73 65 73 20 62  61 63 6b 20 74 6f 20 74  |passes back to t|
00001f00  68 65 20 4d 4f 53 20 28  6c 69 6e 65 73 20 37 31  |he MOS (lines 71|
00001f10  30 2d 38 32 30 29 2e 20  49 66 20 74 68 65 20 61  |0-820). If the a|
00001f20  63 63 75 6d 75 6c 61 74  6f 72 20 64 6f 65 73 20  |ccumulator does |
00001f30  6e 6f 74 0d 63 6f 6e 74  61 69 6e 20 74 68 65 20  |not.contain the |
00001f40  74 65 72 6d 69 6e 61 74  69 6f 6e 20 63 68 61 72  |termination char|
00001f50  61 63 74 65 72 20 69 74  20 6d 75 73 74 20 63 6f  |acter it must co|
00001f60  6e 74 61 69 6e 20 74 68  65 20 6d 6f 73 74 20 73  |ntain the most s|
00001f70  69 67 6e 69 66 69 63 61  6e 74 0d 62 79 74 65 20  |ignificant.byte |
00001f80  6f 66 20 74 68 65 20 6e  65 77 20 72 6f 75 74 69  |of the new routi|
00001f90  6e 65 2e 20 54 68 69 73  20 69 73 20 73 74 6f 72  |ne. This is stor|
00001fa0  65 64 20 69 6e 20 74 68  65 20 6d 6f 73 74 20 73  |ed in the most s|
00001fb0  69 67 6e 69 66 69 63 61  6e 74 20 6f 66 20 74 68  |ignificant of th|
00001fc0  65 0d 74 77 6f 20 63 6f  6e 73 65 63 75 74 69 76  |e.two consecutiv|
00001fd0  65 20 7a 65 72 6f 20 70  61 67 65 20 62 79 74 65  |e zero page byte|
00001fe0  73 20 28 6c 69 6e 65 20  39 30 30 29 2e 20 54 68  |s (line 900). Th|
00001ff0  65 20 58 20 72 65 67 69  73 74 65 72 20 69 73 0d  |e X register is.|
00002000  69 6e 63 72 65 6d 65 6e  74 65 64 20 74 6f 20 70  |incremented to p|
00002010  6f 69 6e 74 20 74 6f 20  74 68 65 20 62 79 74 65  |oint to the byte|
00002020  20 73 74 6f 72 69 6e 67  20 74 68 65 20 6c 65 61  | storing the lea|
00002030  73 74 20 73 69 67 6e 69  66 69 63 61 6e 74 20 62  |st significant b|
00002040  79 74 65 20 6f 66 0d 74  68 65 20 6e 65 77 20 72  |yte of.the new r|
00002050  6f 75 74 69 6e 65 27 73  20 61 64 64 72 65 73 73  |outine's address|
00002060  20 28 6c 69 6e 65 20 39  31 30 29 2e 20 54 68 69  | (line 910). Thi|
00002070  73 20 62 79 74 65 20 69  73 20 6c 6f 61 64 65 64  |s byte is loaded|
00002080  20 69 6e 74 6f 20 74 68  65 0d 61 63 63 75 6d 75  | into the.accumu|
00002090  6c 61 74 6f 72 20 28 6c  69 6e 65 20 39 32 30 29  |lator (line 920)|
000020a0  20 61 6e 64 20 73 74 6f  72 65 64 20 69 6e 20 74  | and stored in t|
000020b0  68 65 20 6c 65 61 73 74  20 73 69 67 6e 69 66 69  |he least signifi|
000020c0  63 61 6e 74 20 6f 66 20  74 68 65 20 74 77 6f 0d  |cant of the two.|
000020d0  7a 65 72 6f 20 70 61 67  65 20 62 79 74 65 73 20  |zero page bytes |
000020e0  28 6c 69 6e 65 20 39 33  30 29 2e 20 54 68 65 20  |(line 930). The |
000020f0  59 20 72 65 67 69 73 74  65 72 20 77 61 73 20 70  |Y register was p|
00002100  75 73 68 65 64 20 6f 6e  20 74 68 65 20 73 74 61  |ushed on the sta|
00002110  63 6b 20 61 73 0d 61 20  74 65 6d 70 6f 72 61 72  |ck as.a temporar|
00002120  79 20 73 74 6f 72 65 20  61 6e 64 20 69 73 20 70  |y store and is p|
00002130  75 6c 6c 65 64 20 6f 66  66 20 61 6e 64 20 64 69  |ulled off and di|
00002140  73 63 61 72 64 65 64 20  28 6c 69 6e 65 20 39 34  |scarded (line 94|
00002150  30 29 2e 20 54 68 65 0d  61 72 67 75 6d 65 6e 74  |0). The.argument|
00002160  20 69 73 20 69 6e 69 74  69 61 6c 69 73 65 64 20  | is initialised |
00002170  28 6c 69 6e 65 73 20 39  35 30 2d 39 36 30 29 20  |(lines 950-960) |
00002180  61 6e 64 20 61 6e 20 69  6e 64 69 72 65 63 74 20  |and an indirect |
00002190  6a 75 6d 70 20 69 73 20  6d 61 64 65 0d 74 6f 20  |jump is made.to |
000021a0  74 68 65 20 6e 65 77 20  72 6f 75 74 69 6e 65 20  |the new routine |
000021b0  28 6c 69 6e 65 20 39 37  30 29 2e 0d 0d 20 20 41  |(line 970)...  A|
000021c0  66 74 65 72 20 74 68 65  20 6e 65 77 20 72 6f 75  |fter the new rou|
000021d0  74 69 6e 65 20 68 61 73  20 62 65 65 6e 20 65 78  |tine has been ex|
000021e0  65 63 75 74 65 64 20 74  68 65 20 74 77 6f 20 7a  |ecuted the two z|
000021f0  65 72 6f 20 70 61 67 65  20 62 79 74 65 73 20 75  |ero page bytes u|
00002200  73 65 64 0d 66 6f 72 20  74 68 65 20 69 6e 64 69  |sed.for the indi|
00002210  72 65 63 74 20 6a 75 6d  70 20 61 72 65 20 72 65  |rect jump are re|
00002220  73 74 6f 72 65 64 20 28  6c 69 6e 65 73 20 31 31  |stored (lines 11|
00002230  39 30 2d 31 32 32 30 29  2c 20 74 68 65 20 73 74  |90-1220), the st|
00002240  61 63 6b 20 69 73 0d 62  61 6c 61 6e 63 65 64 20  |ack is.balanced |
00002250  28 6c 69 6e 65 73 20 31  32 33 30 2d 31 32 35 30  |(lines 1230-1250|
00002260  29 2c 20 74 68 65 20 61  63 63 75 6d 75 6c 61 74  |), the accumulat|
00002270  6f 72 20 69 73 20 6c 6f  61 64 65 64 20 77 69 74  |or is loaded wit|
00002280  68 20 7a 65 72 6f 20 74  6f 0d 69 6e 64 69 63 61  |h zero to.indica|
00002290  74 65 20 74 68 61 74 20  74 68 65 20 63 6f 6d 6d  |te that the comm|
000022a0  61 6e 64 20 68 61 73 20  62 65 65 6e 20 72 65 63  |and has been rec|
000022b0  6f 67 6e 69 73 65 64 20  28 6c 69 6e 65 20 31 32  |ognised (line 12|
000022c0  36 30 29 20 61 6e 64 20  63 6f 6e 74 72 6f 6c 0d  |60) and control.|
000022d0  69 73 20 70 61 73 73 65  64 20 62 61 63 6b 20 74  |is passed back t|
000022e0  6f 20 74 68 65 20 4d 4f  53 20 28 6c 69 6e 65 20  |o the MOS (line |
000022f0  31 32 37 30 29 2e 0d 0d  20 20 55 6e 64 65 72 73  |1270)...  Unders|
00002300  74 61 6e 64 69 6e 67 20  61 6e 64 20 65 78 70 6c  |tanding and expl|
00002310  61 69 6e 69 6e 67 20 68  6f 77 20 74 68 65 20 69  |aining how the i|
00002320  6e 74 65 72 70 72 65 74  65 72 20 77 6f 72 6b 73  |nterpreter works|
00002330  20 69 73 20 6d 75 63 68  20 6d 6f 72 65 0d 64 69  | is much more.di|
00002340  66 66 69 63 75 6c 74 20  74 68 61 6e 20 75 73 69  |fficult than usi|
00002350  6e 67 20 69 74 2e 20 49  6e 20 6f 72 64 65 72 20  |ng it. In order |
00002360  74 6f 20 75 73 65 20 74  68 69 73 20 69 6e 74 65  |to use this inte|
00002370  72 70 72 65 74 65 72 20  77 69 74 68 20 79 6f 75  |rpreter with you|
00002380  72 0d 6f 77 6e 20 70 72  6f 67 72 61 6d 73 20 79  |r.own programs y|
00002390  6f 75 20 6f 6e 6c 79 20  6e 65 65 64 20 74 6f 20  |ou only need to |
000023a0  61 64 64 20 74 68 65 20  63 6f 6d 6d 61 6e 64 20  |add the command |
000023b0  6e 61 6d 65 73 20 74 6f  20 74 68 65 20 63 6f 6d  |names to the com|
000023c0  6d 61 6e 64 0d 74 61 62  6c 65 20 61 6e 64 2c 20  |mand.table and, |
000023d0  6f 66 20 63 6f 75 72 73  65 2c 20 74 68 65 20 6e  |of course, the n|
000023e0  65 77 20 72 6f 75 74 69  6e 65 73 2e 20 59 6f 75  |ew routines. You|
000023f0  20 64 6f 6e 27 74 20 6e  65 65 64 20 74 6f 20 61  | don't need to a|
00002400  6c 74 65 72 20 74 68 65  0d 63 6f 64 69 6e 67 20  |lter the.coding |
00002410  6f 66 20 74 68 65 20 69  6e 74 65 72 70 72 65 74  |of the interpret|
00002420  65 72 20 61 74 20 61 6c  6c 20 77 68 69 63 68 20  |er at all which |
00002430  6d 61 6b 65 73 20 69 74  20 76 65 72 79 20 65 61  |makes it very ea|
00002440  73 79 20 74 6f 20 61 64  61 70 74 20 66 6f 72 0d  |sy to adapt for.|
00002450  79 6f 75 72 20 6f 77 6e  20 73 6f 66 74 77 61 72  |your own softwar|
00002460  65 2e 20 57 68 65 6e 20  79 6f 75 20 61 64 61 70  |e. When you adap|
00002470  74 20 79 6f 75 72 20 6f  77 6e 20 70 72 6f 67 72  |t your own progr|
00002480  61 6d 73 20 74 6f 20 72  75 6e 20 69 6e 20 53 57  |ams to run in SW|
00002490  52 20 77 69 74 68 0d 74  68 69 73 20 69 6e 74 65  |R with.this inte|
000024a0  72 70 72 65 74 65 72 20  79 6f 75 20 6d 75 73 74  |rpreter you must|
000024b0  20 6e 6f 74 20 66 6f 72  67 65 74 20 74 6f 20 75  | not forget to u|
000024c0  73 65 20 61 20 72 6f 75  74 69 6e 65 2c 20 73 75  |se a routine, su|
000024d0  63 68 20 61 73 20 74 68  65 20 6f 6e 65 0d 69 6e  |ch as the one.in|
000024e0  20 6c 69 6e 65 73 20 31  31 38 30 20 74 6f 20 31  | lines 1180 to 1|
000024f0  32 37 30 2c 20 77 68 69  63 68 20 72 65 73 74 6f  |270, which resto|
00002500  72 65 73 20 74 68 65 20  74 77 6f 20 7a 65 72 6f  |res the two zero|
00002510  20 70 61 67 65 20 62 79  74 65 73 20 61 6e 64 0d  | page bytes and.|
00002520  62 61 6c 61 6e 63 65 73  20 74 68 65 20 73 74 61  |balances the sta|
00002530  63 6b 20 62 65 66 6f 72  65 20 72 65 74 75 72 6e  |ck before return|
00002540  69 6e 67 20 63 6f 6e 74  72 6f 6c 20 74 6f 20 74  |ing control to t|
00002550  68 65 20 4d 4f 53 2e 20  52 65 73 74 6f 72 69 6e  |he MOS. Restorin|
00002560  67 20 74 68 65 0d 6d 65  6d 6f 72 79 20 75 73 65  |g the.memory use|
00002570  64 20 62 79 20 74 68 65  20 69 6e 74 65 72 70 72  |d by the interpr|
00002580  65 74 65 72 2c 20 62 61  6c 61 6e 63 69 6e 67 20  |eter, balancing |
00002590  74 68 65 20 73 74 61 63  6b 20 61 6e 64 20 6c 6f  |the stack and lo|
000025a0  61 64 69 6e 67 20 74 68  65 0d 61 63 63 75 6d 75  |ading the.accumu|
000025b0  6c 61 74 6f 72 20 77 69  74 68 20 7a 65 72 6f 20  |lator with zero |
000025c0  62 65 66 6f 72 65 20 72  65 74 75 72 6e 69 6e 67  |before returning|
000025d0  20 69 73 20 61 62 73 6f  6c 75 74 65 6c 79 20 76  | is absolutely v|
000025e0  69 74 61 6c 2e 20 54 68  69 73 0d 6d 75 6c 74 69  |ital. This.multi|
000025f0  70 6c 65 20 63 6f 6d 6d  61 6e 64 20 69 6e 74 65  |ple command inte|
00002600  72 70 72 65 74 65 72 20  77 69 6c 6c 20 6e 6f 74  |rpreter will not|
00002610  20 77 6f 72 6b 20 70 72  6f 70 65 72 6c 79 20 69  | work properly i|
00002620  66 20 79 6f 75 20 6c 65  61 76 65 20 6f 75 74 0d  |f you leave out.|
00002630  74 68 69 73 20 65 73 73  65 6e 74 69 61 6c 20 6c  |this essential l|
00002640  61 73 74 20 72 6f 75 74  69 6e 65 2e 0d 0d 20 20  |ast routine...  |
00002650  54 68 69 73 20 69 6e 74  65 72 70 72 65 74 65 72  |This interpreter|
00002660  20 77 69 6c 6c 20 62 65  20 64 65 76 65 6c 6f 70  | will be develop|
00002670  65 64 20 66 75 72 74 68  65 72 20 69 6e 20 74 68  |ed further in th|
00002680  65 20 6e 65 78 74 20 6d  6f 64 75 6c 65 20 74 6f  |e next module to|
00002690  0d 69 6e 63 6c 75 64 65  20 61 20 2a 48 45 4c 50  |.include a *HELP|
000026a0  20 73 65 72 76 69 63 65  2e 0d 0d 0d 0d 0d 0d 20  | service....... |
000026b0  20 20 31 30 20 52 45 4d  3a 20 53 4f 55 4e 44 53  |  10 REM: SOUNDS|
000026c0  0d 20 20 20 32 30 20 4d  4f 44 45 37 0d 20 20 20  |.   20 MODE7.   |
000026d0  33 30 20 48 49 4d 45 4d  3d 26 33 43 30 30 0d 20  |30 HIMEM=&3C00. |
000026e0  20 20 34 30 20 44 49 4d  20 73 61 76 65 20 35 30  |  40 DIM save 50|
000026f0  0d 20 20 20 35 30 20 64  69 66 66 3d 26 38 30 30  |.   50 diff=&800|
00002700  30 2d 48 49 4d 45 4d 0d  20 20 20 36 30 20 61 64  |0-HIMEM.   60 ad|
00002710  64 72 65 73 73 3d 26 37  30 0d 20 20 20 37 30 20  |dress=&70.   70 |
00002720  63 6f 6d 76 65 63 3d 26  46 32 0d 20 20 20 38 30  |comvec=&F2.   80|
00002730  20 67 73 69 6e 69 74 3d  26 46 46 43 32 0d 20 20  | gsinit=&FFC2.  |
00002740  20 39 30 20 67 73 72 65  61 64 3d 26 46 46 43 35  | 90 gsread=&FFC5|
00002750  0d 20 20 31 30 30 20 6f  73 77 6f 72 64 3d 26 46  |.  100 osword=&F|
00002760  46 46 31 0d 20 20 31 31  30 20 6f 73 63 6c 69 3d  |FF1.  110 oscli=|
00002770  26 46 46 46 37 0d 20 20  31 32 30 20 46 4f 52 20  |&FFF7.  120 FOR |
00002780  70 61 73 73 20 3d 20 30  20 54 4f 20 32 20 53 54  |pass = 0 TO 2 ST|
00002790  45 50 20 32 0d 20 20 31  33 30 20 50 25 3d 48 49  |EP 2.  130 P%=HI|
000027a0  4d 45 4d 0d 20 20 31 34  30 20 5b 20 20 20 20 20  |MEM.  140 [     |
000027b0  20 20 4f 50 54 20 70 61  73 73 0d 20 20 31 35 30  |  OPT pass.  150|
000027c0  20 20 20 20 20 20 20 20  20 42 52 4b 0d 20 20 31  |         BRK.  1|
000027d0  36 30 20 20 20 20 20 20  20 20 20 42 52 4b 0d 20  |60         BRK. |
000027e0  20 31 37 30 20 20 20 20  20 20 20 20 20 42 52 4b  | 170         BRK|
000027f0  0d 20 20 31 38 30 20 20  20 20 20 20 20 20 20 4a  |.  180         J|
00002800  4d 50 20 73 65 72 76 69  63 65 2b 64 69 66 66 0d  |MP service+diff.|
00002810  20 20 31 39 30 20 20 20  20 20 20 20 20 20 4f 50  |  190         OP|
00002820  54 20 46 4e 65 71 75 62  28 26 38 32 29 0d 20 20  |T FNequb(&82).  |
00002830  32 30 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |200         OPT |
00002840  46 4e 65 71 75 62 28 28  63 6f 70 79 72 69 67 68  |FNequb((copyrigh|
00002850  74 2b 64 69 66 66 29 20  4d 4f 44 20 32 35 36 29  |t+diff) MOD 256)|
00002860  0d 20 20 32 31 30 20 20  20 20 20 20 20 20 20 42  |.  210         B|
00002870  52 4b 0d 20 20 32 32 30  20 20 20 20 20 20 20 20  |RK.  220        |
00002880  20 4f 50 54 20 46 4e 65  71 75 73 28 22 53 4f 55  | OPT FNequs("SOU|
00002890  4e 44 53 22 29 0d 20 20  32 33 30 20 2e 63 6f 70  |NDS").  230 .cop|
000028a0  79 72 69 67 68 74 0d 20  20 32 34 30 20 20 20 20  |yright.  240    |
000028b0  20 20 20 20 20 42 52 4b  0d 20 20 32 35 30 20 20  |     BRK.  250  |
000028c0  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
000028d0  73 28 22 28 43 29 20 47  6f 72 64 6f 6e 20 48 6f  |s("(C) Gordon Ho|
000028e0  72 73 69 6e 67 74 6f 6e  20 31 39 38 37 22 29 0d  |rsington 1987").|
000028f0  20 20 32 36 30 20 20 20  20 20 20 20 20 20 42 52  |  260         BR|
00002900  4b 0d 20 20 32 37 30 20  2e 73 65 72 76 69 63 65  |K.  270 .service|
00002910  0d 20 20 32 38 30 20 20  20 20 20 20 20 20 20 43  |.  280         C|
00002920  4d 50 20 23 34 0d 20 20  32 39 30 20 20 20 20 20  |MP #4.  290     |
00002930  20 20 20 20 42 45 51 20  75 6e 72 65 63 6f 67 6e  |    BEQ unrecogn|
00002940  69 73 65 64 0d 20 20 33  30 30 20 20 20 20 20 20  |ised.  300      |
00002950  20 20 20 52 54 53 0d 20  20 33 31 30 20 2e 75 6e  |   RTS.  310 .un|
00002960  72 65 63 6f 67 6e 69 73  65 64 0d 20 20 33 32 30  |recognised.  320|
00002970  20 20 20 20 20 20 20 20  20 50 48 41 0d 20 20 33  |         PHA.  3|
00002980  33 30 20 20 20 20 20 20  20 20 20 54 58 41 0d 20  |30         TXA. |
00002990  20 33 34 30 20 20 20 20  20 20 20 20 20 50 48 41  | 340         PHA|
000029a0  0d 20 20 33 35 30 20 20  20 20 20 20 20 20 20 54  |.  350         T|
000029b0  59 41 0d 20 20 33 36 30  20 20 20 20 20 20 20 20  |YA.  360        |
000029c0  20 50 48 41 0d 20 20 33  37 30 20 20 20 20 20 20  | PHA.  370      |
000029d0  20 20 20 4c 44 41 20 61  64 64 72 65 73 73 0d 20  |   LDA address. |
000029e0  20 33 38 30 20 20 20 20  20 20 20 20 20 50 48 41  | 380         PHA|
000029f0  0d 20 20 33 39 30 20 20  20 20 20 20 20 20 20 4c  |.  390         L|
00002a00  44 41 20 61 64 64 72 65  73 73 2b 31 0d 20 20 34  |DA address+1.  4|
00002a10  30 30 20 20 20 20 20 20  20 20 20 50 48 41 0d 20  |00         PHA. |
00002a20  20 34 31 30 20 20 20 20  20 20 20 20 20 4c 44 58  | 410         LDX|
00002a30  20 23 26 46 45 0d 20 20  34 32 30 20 20 20 20 20  | #&FE.  420     |
00002a40  20 20 20 20 54 59 41 0d  20 20 34 33 30 20 20 20  |    TYA.  430   |
00002a50  20 20 20 20 20 20 50 48  41 0d 20 20 34 34 30 20  |      PHA.  440 |
00002a60  2e 66 69 72 73 74 63 68  61 72 0d 20 20 34 35 30  |.firstchar.  450|
00002a70  20 20 20 20 20 20 20 20  20 49 4e 58 0d 20 20 34  |         INX.  4|
00002a80  36 30 20 20 20 20 20 20  20 20 20 50 4c 41 0d 20  |60         PLA. |
00002a90  20 34 37 30 20 20 20 20  20 20 20 20 20 54 41 59  | 470         TAY|
00002aa0  0d 20 20 34 38 30 20 20  20 20 20 20 20 20 20 50  |.  480         P|
00002ab0  48 41 0d 20 20 34 39 30  20 20 20 20 20 20 20 20  |HA.  490        |
00002ac0  20 4c 44 41 20 28 63 6f  6d 76 65 63 29 2c 59 0d  | LDA (comvec),Y.|
00002ad0  20 20 35 30 30 20 20 20  20 20 20 20 20 20 41 4e  |  500         AN|
00002ae0  44 20 23 26 44 46 0d 20  20 35 31 30 20 20 20 20  |D #&DF.  510    |
00002af0  20 20 20 20 20 43 4d 50  20 23 41 53 43 28 22 58  |     CMP #ASC("X|
00002b00  22 29 0d 20 20 35 32 30  20 20 20 20 20 20 20 20  |").  520        |
00002b10  20 42 4e 45 20 69 6e 74  65 72 70 72 65 74 0d 20  | BNE interpret. |
00002b20  20 35 33 30 20 20 20 20  20 20 20 20 20 49 4e 59  | 530         INY|
00002b30  0d 20 20 35 34 30 20 2e  69 6e 74 65 72 70 72 65  |.  540 .interpre|
00002b40  74 0d 20 20 35 35 30 20  20 20 20 20 20 20 20 20  |t.  550         |
00002b50  49 4e 58 0d 20 20 35 36  30 20 20 20 20 20 20 20  |INX.  560       |
00002b60  20 20 4c 44 41 20 63 6f  6d 6d 74 61 62 6c 65 2b  |  LDA commtable+|
00002b70  64 69 66 66 2c 58 0d 20  20 35 37 30 20 20 20 20  |diff,X.  570    |
00002b80  20 20 20 20 20 42 4d 49  20 66 6f 75 6e 64 0d 20  |     BMI found. |
00002b90  20 35 38 30 20 20 20 20  20 20 20 20 20 4c 44 41  | 580         LDA|
00002ba0  20 28 63 6f 6d 76 65 63  29 2c 59 0d 20 20 35 39  | (comvec),Y.  59|
00002bb0  30 20 20 20 20 20 20 20  20 20 49 4e 59 0d 20 20  |0         INY.  |
00002bc0  36 30 30 20 20 20 20 20  20 20 20 20 43 4d 50 20  |600         CMP |
00002bd0  23 41 53 43 28 22 2e 22  29 0d 20 20 36 31 30 20  |#ASC(".").  610 |
00002be0  20 20 20 20 20 20 20 20  42 45 51 20 66 6f 75 6e  |        BEQ foun|
00002bf0  64 64 6f 74 0d 20 20 36  32 30 20 20 20 20 20 20  |ddot.  620      |
00002c00  20 20 20 41 4e 44 20 23  26 44 46 0d 20 20 36 33  |   AND #&DF.  63|
00002c10  30 20 20 20 20 20 20 20  20 20 43 4d 50 20 63 6f  |0         CMP co|
00002c20  6d 6d 74 61 62 6c 65 2b  64 69 66 66 2c 58 0d 20  |mmtable+diff,X. |
00002c30  20 36 34 30 20 20 20 20  20 20 20 20 20 42 45 51  | 640         BEQ|
00002c40  20 69 6e 74 65 72 70 72  65 74 0d 20 20 36 35 30  | interpret.  650|
00002c50  20 2e 61 6e 6f 74 68 65  72 0d 20 20 36 36 30 20  | .another.  660 |
00002c60  20 20 20 20 20 20 20 20  49 4e 58 0d 20 20 36 37  |        INX.  67|
00002c70  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 63 6f  |0         LDA co|
00002c80  6d 6d 74 61 62 6c 65 2b  64 69 66 66 2c 58 0d 20  |mmtable+diff,X. |
00002c90  20 36 38 30 20 20 20 20  20 20 20 20 20 42 50 4c  | 680         BPL|
00002ca0  20 61 6e 6f 74 68 65 72  0d 20 20 36 39 30 20 20  | another.  690  |
00002cb0  20 20 20 20 20 20 20 43  4d 50 20 23 26 46 46 0d  |       CMP #&FF.|
00002cc0  20 20 37 30 30 20 20 20  20 20 20 20 20 20 42 4e  |  700         BN|
00002cd0  45 20 66 69 72 73 74 63  68 61 72 0d 20 20 37 31  |E firstchar.  71|
00002ce0  30 20 2e 65 78 69 74 0d  20 20 37 32 30 20 20 20  |0 .exit.  720   |
00002cf0  20 20 20 20 20 20 50 4c  41 0d 20 20 37 33 30 20  |      PLA.  730 |
00002d00  20 20 20 20 20 20 20 20  50 4c 41 0d 20 20 37 34  |        PLA.  74|
00002d10  30 20 20 20 20 20 20 20  20 20 53 54 41 20 61 64  |0         STA ad|
00002d20  64 72 65 73 73 2b 31 0d  20 20 37 35 30 20 20 20  |dress+1.  750   |
00002d30  20 20 20 20 20 20 50 4c  41 0d 20 20 37 36 30 20  |      PLA.  760 |
00002d40  20 20 20 20 20 20 20 20  53 54 41 20 61 64 64 72  |        STA addr|
00002d50  65 73 73 0d 20 20 37 37  30 20 20 20 20 20 20 20  |ess.  770       |
00002d60  20 20 50 4c 41 0d 20 20  37 38 30 20 20 20 20 20  |  PLA.  780     |
00002d70  20 20 20 20 54 41 59 0d  20 20 37 39 30 20 20 20  |    TAY.  790   |
00002d80  20 20 20 20 20 20 50 4c  41 0d 20 20 38 30 30 20  |      PLA.  800 |
00002d90  20 20 20 20 20 20 20 20  54 41 58 0d 20 20 38 31  |        TAX.  81|
00002da0  30 20 20 20 20 20 20 20  20 20 50 4c 41 0d 20 20  |0         PLA.  |
00002db0  38 32 30 20 20 20 20 20  20 20 20 20 52 54 53 0d  |820         RTS.|
00002dc0  20 20 38 33 30 20 2e 66  6f 75 6e 64 64 6f 74 0d  |  830 .founddot.|
00002dd0  20 20 38 34 30 20 20 20  20 20 20 20 20 20 49 4e  |  840         IN|
00002de0  58 0d 20 20 38 35 30 20  20 20 20 20 20 20 20 20  |X.  850         |
00002df0  4c 44 41 20 63 6f 6d 6d  74 61 62 6c 65 2b 64 69  |LDA commtable+di|
00002e00  66 66 2c 58 0d 20 20 38  36 30 20 20 20 20 20 20  |ff,X.  860      |
00002e10  20 20 20 42 50 4c 20 66  6f 75 6e 64 64 6f 74 0d  |   BPL founddot.|
00002e20  20 20 38 37 30 20 2e 66  6f 75 6e 64 0d 20 20 38  |  870 .found.  8|
00002e30  38 30 20 20 20 20 20 20  20 20 20 43 4d 50 20 23  |80         CMP #|
00002e40  26 46 46 0d 20 20 38 39  30 20 20 20 20 20 20 20  |&FF.  890       |
00002e50  20 20 42 45 51 20 65 78  69 74 0d 20 20 39 30 30  |  BEQ exit.  900|
00002e60  20 20 20 20 20 20 20 20  20 53 54 41 20 61 64 64  |         STA add|
00002e70  72 65 73 73 2b 31 0d 20  20 39 31 30 20 20 20 20  |ress+1.  910    |
00002e80  20 20 20 20 20 49 4e 58  0d 20 20 39 32 30 20 20  |     INX.  920  |
00002e90  20 20 20 20 20 20 20 4c  44 41 20 63 6f 6d 6d 74  |       LDA commt|
00002ea0  61 62 6c 65 2b 64 69 66  66 2c 58 0d 20 20 39 33  |able+diff,X.  93|
00002eb0  30 20 20 20 20 20 20 20  20 20 53 54 41 20 61 64  |0         STA ad|
00002ec0  64 72 65 73 73 0d 20 20  39 34 30 20 20 20 20 20  |dress.  940     |
00002ed0  20 20 20 20 50 4c 41 0d  20 20 39 35 30 20 20 20  |    PLA.  950   |
00002ee0  20 20 20 20 20 20 53 45  43 0d 20 20 39 36 30 20  |      SEC.  960 |
00002ef0  20 20 20 20 20 20 20 20  4a 53 52 20 67 73 69 6e  |        JSR gsin|
00002f00  69 74 0d 20 20 39 37 30  20 20 20 20 20 20 20 20  |it.  970        |
00002f10  20 4a 4d 50 20 28 61 64  64 72 65 73 73 29 0d 20  | JMP (address). |
00002f20  20 39 38 30 20 2e 63 6f  6d 6d 74 61 62 6c 65 0d  | 980 .commtable.|
00002f30  20 20 39 39 30 20 20 20  20 20 20 20 20 20 4f 50  |  990         OP|
00002f40  54 20 46 4e 65 71 75 73  28 22 53 49 52 45 4e 22  |T FNequs("SIREN"|
00002f50  29 0d 20 31 30 30 30 20  20 20 20 20 20 20 20 20  |). 1000         |
00002f60  4f 50 54 20 46 4e 65 71  75 62 28 28 73 69 72 65  |OPT FNequb((sire|
00002f70  6e 2b 64 69 66 66 29 20  44 49 56 20 32 35 36 29  |n+diff) DIV 256)|
00002f80  0d 20 31 30 31 30 20 20  20 20 20 20 20 20 20 4f  |. 1010         O|
00002f90  50 54 20 46 4e 65 71 75  62 28 28 73 69 72 65 6e  |PT FNequb((siren|
00002fa0  2b 64 69 66 66 29 20 4d  4f 44 20 32 35 36 29 0d  |+diff) MOD 256).|
00002fb0  20 31 30 32 30 20 20 20  20 20 20 20 20 20 4f 50  | 1020         OP|
00002fc0  54 20 46 4e 65 71 75 73  28 22 48 45 48 45 22 29  |T FNequs("HEHE")|
00002fd0  0d 20 31 30 33 30 20 20  20 20 20 20 20 20 20 4f  |. 1030         O|
00002fe0  50 54 20 46 4e 65 71 75  62 28 28 68 65 68 65 2b  |PT FNequb((hehe+|
00002ff0  64 69 66 66 29 20 44 49  56 20 32 35 36 29 0d 20  |diff) DIV 256). |
00003000  31 30 34 30 20 20 20 20  20 20 20 20 20 4f 50 54  |1040         OPT|
00003010  20 46 4e 65 71 75 62 28  28 68 65 68 65 2b 64 69  | FNequb((hehe+di|
00003020  66 66 29 20 4d 4f 44 20  32 35 36 29 0d 20 31 30  |ff) MOD 256). 10|
00003030  35 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |50         OPT F|
00003040  4e 65 71 75 73 28 22 55  46 4f 22 29 0d 20 31 30  |Nequs("UFO"). 10|
00003050  36 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |60         OPT F|
00003060  4e 65 71 75 62 28 28 75  66 6f 2b 64 69 66 66 29  |Nequb((ufo+diff)|
00003070  20 44 49 56 20 32 35 36  29 0d 20 31 30 37 30 20  | DIV 256). 1070 |
00003080  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00003090  75 62 28 28 75 66 6f 2b  64 69 66 66 29 20 4d 4f  |ub((ufo+diff) MO|
000030a0  44 20 32 35 36 29 0d 20  31 30 38 30 20 20 20 20  |D 256). 1080    |
000030b0  20 20 20 20 20 4f 50 54  20 46 4e 65 71 75 62 28  |     OPT FNequb(|
000030c0  26 46 46 29 0d 20 31 30  39 30 20 2e 68 65 68 65  |&FF). 1090 .hehe|
000030d0  0d 20 31 31 30 30 20 20  20 20 20 20 20 20 20 4c  |. 1100         L|
000030e0  44 41 20 23 38 0d 20 31  31 31 30 20 20 20 20 20  |DA #8. 1110     |
000030f0  20 20 20 20 4c 44 58 20  23 28 65 68 65 68 65 2b  |    LDX #(ehehe+|
00003100  64 69 66 66 29 20 4d 4f  44 20 32 35 36 0d 20 31  |diff) MOD 256. 1|
00003110  31 32 30 20 20 20 20 20  20 20 20 20 4c 44 59 20  |120         LDY |
00003120  23 28 65 68 65 68 65 2b  64 69 66 66 29 20 44 49  |#(ehehe+diff) DI|
00003130  56 20 32 35 36 0d 20 31  31 33 30 20 20 20 20 20  |V 256. 1130     |
00003140  20 20 20 20 4a 53 52 20  6f 73 77 6f 72 64 20 20  |    JSR osword  |
00003150  20 20 5c 20 45 6e 76 65  6c 6f 70 65 0d 20 31 31  |  \ Envelope. 11|
00003160  34 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 23  |40         LDA #|
00003170  37 0d 20 31 31 35 30 20  20 20 20 20 20 20 20 20  |7. 1150         |
00003180  4c 44 58 20 23 28 73 68  65 68 65 2b 64 69 66 66  |LDX #(shehe+diff|
00003190  29 20 4d 4f 44 20 32 35  36 0d 20 31 31 36 30 20  |) MOD 256. 1160 |
000031a0  20 20 20 20 20 20 20 20  4c 44 59 20 23 28 73 68  |        LDY #(sh|
000031b0  65 68 65 2b 64 69 66 66  29 20 44 49 56 20 32 35  |ehe+diff) DIV 25|
000031c0  36 0d 20 31 31 37 30 20  20 20 20 20 20 20 20 20  |6. 1170         |
000031d0  4a 53 52 20 6f 73 77 6f  72 64 20 20 20 20 5c 20  |JSR osword    \ |
000031e0  53 6f 75 6e 64 0d 20 31  31 38 30 20 2e 70 75 6c  |Sound. 1180 .pul|
000031f0  6c 6f 75 74 0d 20 31 31  39 30 20 20 20 20 20 20  |lout. 1190      |
00003200  20 20 20 50 4c 41 0d 20  31 32 30 30 20 20 20 20  |   PLA. 1200    |
00003210  20 20 20 20 20 53 54 41  20 61 64 64 72 65 73 73  |     STA address|
00003220  2b 31 0d 20 31 32 31 30  20 20 20 20 20 20 20 20  |+1. 1210        |
00003230  20 50 4c 41 0d 20 31 32  32 30 20 20 20 20 20 20  | PLA. 1220      |
00003240  20 20 20 53 54 41 20 61  64 64 72 65 73 73 0d 20  |   STA address. |
00003250  31 32 33 30 20 20 20 20  20 20 20 20 20 50 4c 41  |1230         PLA|
00003260  0d 20 31 32 34 30 20 20  20 20 20 20 20 20 20 50  |. 1240         P|
00003270  4c 41 0d 20 31 32 35 30  20 20 20 20 20 20 20 20  |LA. 1250        |
00003280  20 50 4c 41 0d 20 31 32  36 30 20 20 20 20 20 20  | PLA. 1260      |
00003290  20 20 20 4c 44 41 20 23  30 0d 20 31 32 37 30 20  |   LDA #0. 1270 |
000032a0  20 20 20 20 20 20 20 20  52 54 53 0d 20 31 32 38  |        RTS. 128|
000032b0  30 20 2e 73 69 72 65 6e  0d 20 31 32 39 30 20 20  |0 .siren. 1290  |
000032c0  20 20 20 20 20 20 20 4c  44 41 20 23 38 0d 20 31  |       LDA #8. 1|
000032d0  33 30 30 20 20 20 20 20  20 20 20 20 4c 44 58 20  |300         LDX |
000032e0  23 28 65 73 69 72 65 6e  2b 64 69 66 66 29 20 4d  |#(esiren+diff) M|
000032f0  4f 44 20 32 35 36 0d 20  31 33 31 30 20 20 20 20  |OD 256. 1310    |
00003300  20 20 20 20 20 4c 44 59  20 23 28 65 73 69 72 65  |     LDY #(esire|
00003310  6e 2b 64 69 66 66 29 20  44 49 56 20 32 35 36 0d  |n+diff) DIV 256.|
00003320  20 31 33 32 30 20 20 20  20 20 20 20 20 20 4a 53  | 1320         JS|
00003330  52 20 6f 73 77 6f 72 64  20 20 20 20 5c 20 45 6e  |R osword    \ En|
00003340  76 65 6c 6f 70 65 0d 20  31 33 33 30 20 20 20 20  |velope. 1330    |
00003350  20 20 20 20 20 4c 44 41  20 23 37 0d 20 31 33 34  |     LDA #7. 134|
00003360  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 28  |0         LDX #(|
00003370  73 73 69 72 65 6e 2b 64  69 66 66 29 20 4d 4f 44  |ssiren+diff) MOD|
00003380  20 32 35 36 0d 20 31 33  35 30 20 20 20 20 20 20  | 256. 1350      |
00003390  20 20 20 4c 44 59 20 23  28 73 73 69 72 65 6e 2b  |   LDY #(ssiren+|
000033a0  64 69 66 66 29 20 44 49  56 20 32 35 36 0d 20 31  |diff) DIV 256. 1|
000033b0  33 36 30 20 20 20 20 20  20 20 20 20 4a 53 52 20  |360         JSR |
000033c0  6f 73 77 6f 72 64 20 20  20 20 5c 20 53 6f 75 6e  |osword    \ Soun|
000033d0  64 0d 20 31 33 37 30 20  20 20 20 20 20 20 20 20  |d. 1370         |
000033e0  4a 4d 50 20 70 75 6c 6c  6f 75 74 2b 64 69 66 66  |JMP pullout+diff|
000033f0  0d 20 31 33 38 30 20 2e  75 66 6f 0d 20 31 33 39  |. 1380 .ufo. 139|
00003400  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 23 38  |0         LDA #8|
00003410  0d 20 31 34 30 30 20 20  20 20 20 20 20 20 20 4c  |. 1400         L|
00003420  44 58 20 23 28 65 75 66  6f 2b 64 69 66 66 29 20  |DX #(eufo+diff) |
00003430  4d 4f 44 20 32 35 36 0d  20 31 34 31 30 20 20 20  |MOD 256. 1410   |
00003440  20 20 20 20 20 20 4c 44  59 20 23 28 65 75 66 6f  |      LDY #(eufo|
00003450  2b 64 69 66 66 29 20 44  49 56 20 32 35 36 0d 20  |+diff) DIV 256. |
00003460  31 34 32 30 20 20 20 20  20 20 20 20 20 4a 53 52  |1420         JSR|
00003470  20 6f 73 77 6f 72 64 20  20 20 20 5c 20 45 6e 76  | osword    \ Env|
00003480  65 6c 6f 70 65 0d 20 31  34 33 30 20 20 20 20 20  |elope. 1430     |
00003490  20 20 20 20 4c 44 41 20  23 37 0d 20 31 34 34 30  |    LDA #7. 1440|
000034a0  20 20 20 20 20 20 20 20  20 4c 44 58 20 23 28 73  |         LDX #(s|
000034b0  75 66 6f 2b 64 69 66 66  29 20 4d 4f 44 20 32 35  |ufo+diff) MOD 25|
000034c0  36 0d 20 31 34 35 30 20  20 20 20 20 20 20 20 20  |6. 1450         |
000034d0  4c 44 59 20 23 28 73 75  66 6f 2b 64 69 66 66 29  |LDY #(sufo+diff)|
000034e0  20 44 49 56 20 32 35 36  0d 20 31 34 36 30 20 20  | DIV 256. 1460  |
000034f0  20 20 20 20 20 20 20 4a  53 52 20 6f 73 77 6f 72  |       JSR oswor|
00003500  64 20 20 20 20 5c 20 53  6f 75 6e 64 0d 20 31 34  |d    \ Sound. 14|
00003510  37 30 20 20 20 20 20 20  20 20 20 4a 4d 50 20 70  |70         JMP p|
00003520  75 6c 6c 6f 75 74 2b 64  69 66 66 0d 20 31 34 38  |ullout+diff. 148|
00003530  30 20 2e 65 68 65 68 65  0d 20 31 34 39 30 20 20  |0 .ehehe. 1490  |
00003540  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00003550  64 28 26 30 32 46 46 30  33 30 31 29 0d 20 31 35  |d(&02FF0301). 15|
00003560  30 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |00         OPT F|
00003570  4e 65 71 75 64 28 26 34  36 31 45 31 45 33 32 29  |Nequd(&461E1E32)|
00003580  0d 20 31 35 31 30 20 20  20 20 20 20 20 20 20 4f  |. 1510         O|
00003590  50 54 20 46 4e 65 71 75  64 28 26 46 46 46 46 46  |PT FNequd(&FFFFF|
000035a0  46 37 46 29 0d 20 31 35  32 30 20 20 20 20 20 20  |F7F). 1520      |
000035b0  20 20 20 4f 50 54 20 46  4e 65 71 75 77 28 26 37  |   OPT FNequw(&7|
000035c0  45 37 45 29 0d 20 31 35  33 30 20 2e 73 68 65 68  |E7E). 1530 .sheh|
000035d0  65 0d 20 31 35 34 30 20  20 20 20 20 20 20 20 20  |e. 1540         |
000035e0  4f 50 54 20 46 4e 65 71  75 64 28 26 30 30 30 31  |OPT FNequd(&0001|
000035f0  30 30 31 31 29 0d 20 31  35 35 30 20 20 20 20 20  |0011). 1550     |
00003600  20 20 20 20 4f 50 54 20  46 4e 65 71 75 64 28 26  |    OPT FNequd(&|
00003610  30 30 33 32 30 30 37 35  29 0d 20 31 35 36 30 20  |00320075). 1560 |
00003620  2e 65 73 69 72 65 6e 0d  20 31 35 37 30 20 20 20  |.esiren. 1570   |
00003630  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 64  |      OPT FNequd|
00003640  28 26 30 37 46 39 30 31  30 32 29 0d 20 31 35 38  |(&07F90102). 158|
00003650  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00003660  65 71 75 64 28 26 30 30  30 41 30 41 30 30 29 0d  |equd(&000A0A00).|
00003670  20 31 35 39 30 20 20 20  20 20 20 20 20 20 4f 50  | 1590         OP|
00003680  54 20 46 4e 65 71 75 64  28 26 38 32 30 30 30 30  |T FNequd(&820000|
00003690  37 45 29 0d 20 31 36 30  30 20 20 20 20 20 20 20  |7E). 1600       |
000036a0  20 20 4f 50 54 20 46 4e  65 71 75 77 28 26 37 45  |  OPT FNequw(&7E|
000036b0  37 45 29 0d 20 31 36 31  30 20 2e 73 73 69 72 65  |7E). 1610 .ssire|
000036c0  6e 0d 20 31 36 32 30 20  20 20 20 20 20 20 20 20  |n. 1620         |
000036d0  4f 50 54 20 46 4e 65 71  75 64 28 26 30 30 30 32  |OPT FNequd(&0002|
000036e0  30 30 31 32 29 0d 20 31  36 33 30 20 20 20 20 20  |0012). 1630     |
000036f0  20 20 20 20 4f 50 54 20  46 4e 65 71 75 64 28 26  |    OPT FNequd(&|
00003700  30 30 46 46 30 30 38 38  29 0d 20 31 36 34 30 20  |00FF0088). 1640 |
00003710  2e 65 75 66 6f 0d 20 31  36 35 30 20 20 20 20 20  |.eufo. 1650     |
00003720  20 20 20 20 4f 50 54 20  46 4e 65 71 75 64 28 26  |    OPT FNequd(&|
00003730  46 46 30 31 30 31 30 33  29 0d 20 31 36 36 30 20  |FF010103). 1660 |
00003740  20 20 20 20 20 20 20 20  4f 50 54 20 46 4e 65 71  |        OPT FNeq|
00003750  75 64 28 26 30 31 30 38  30 37 30 30 29 0d 20 31  |ud(&01080700). 1|
00003760  36 37 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |670         OPT |
00003770  46 4e 65 71 75 64 28 26  46 46 30 30 46 46 30 33  |FNequd(&FF00FF03|
00003780  29 0d 20 31 36 38 30 20  20 20 20 20 20 20 20 20  |). 1680         |
00003790  4f 50 54 20 46 4e 65 71  75 77 28 26 37 45 37 45  |OPT FNequw(&7E7E|
000037a0  29 0d 20 31 36 39 30 20  2e 73 75 66 6f 0d 20 31  |). 1690 .sufo. 1|
000037b0  37 30 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |700         OPT |
000037c0  46 4e 65 71 75 64 28 26  30 30 30 33 30 30 31 33  |FNequd(&00030013|
000037d0  29 0d 20 31 37 31 30 20  20 20 20 20 20 20 20 20  |). 1710         |
000037e0  4f 50 54 20 46 4e 65 71  75 64 28 26 30 30 33 43  |OPT FNequd(&003C|
000037f0  30 30 38 32 29 0d 20 31  37 32 30 20 2e 6c 61 73  |0082). 1720 .las|
00003800  74 62 79 74 65 0d 20 31  37 33 30 20 5d 0d 20 31  |tbyte. 1730 ]. 1|
00003810  37 34 30 20 4e 45 58 54  0d 20 31 37 35 30 20 49  |740 NEXT. 1750 I|
00003820  4e 50 55 54 27 22 53 61  76 65 20 66 69 6c 65 6e  |NPUT'"Save filen|
00003830  61 6d 65 20 3d 20 22 66  69 6c 65 6e 61 6d 65 24  |ame = "filename$|
00003840  0d 20 31 37 36 30 20 49  46 20 66 69 6c 65 6e 61  |. 1760 IF filena|
00003850  6d 65 24 3d 22 22 20 45  4e 44 0d 20 31 37 37 30  |me$="" END. 1770|
00003860  20 24 73 61 76 65 3d 22  53 41 56 45 20 22 2b 66  | $save="SAVE "+f|
00003870  69 6c 65 6e 61 6d 65 24  2b 22 20 22 2b 53 54 52  |ilename$+" "+STR|
00003880  24 7e 28 48 49 4d 45 4d  29 2b 22 20 22 2b 53 54  |$~(HIMEM)+" "+ST|
00003890  52 24 7e 28 6c 61 73 0d  20 20 20 20 20 20 74 62  |R$~(las.      tb|
000038a0  79 74 65 29 2b 22 20 46  46 46 46 38 30 30 30 20  |yte)+" FFFF8000 |
000038b0  46 46 46 46 38 30 30 30  22 0d 20 31 37 38 30 20  |FFFF8000". 1780 |
000038c0  58 25 3d 73 61 76 65 20  4d 4f 44 20 32 35 36 0d  |X%=save MOD 256.|
000038d0  20 31 37 39 30 20 59 25  3d 73 61 76 65 20 44 49  | 1790 Y%=save DI|
000038e0  56 20 32 35 36 0d 20 31  38 30 30 20 2a 4f 50 54  |V 256. 1800 *OPT|
000038f0  31 2c 32 0d 20 31 38 31  30 20 43 41 4c 4c 20 6f  |1,2. 1810 CALL o|
00003900  73 63 6c 69 0d 20 31 38  32 30 20 2a 4f 50 54 31  |scli. 1820 *OPT1|
00003910  2c 30 0d 20 31 38 33 30  20 45 4e 44 0d 20 31 38  |,0. 1830 END. 18|
00003920  34 30 20 44 45 46 46 4e  65 71 75 62 28 62 79 74  |40 DEFFNequb(byt|
00003930  65 29 0d 20 31 38 35 30  20 3f 50 25 3d 62 79 74  |e). 1850 ?P%=byt|
00003940  65 0d 20 31 38 36 30 20  50 25 3d 50 25 2b 31 0d  |e. 1860 P%=P%+1.|
00003950  20 31 38 37 30 20 3d 70  61 73 73 0d 20 31 38 38  | 1870 =pass. 188|
00003960  30 20 44 45 46 46 4e 65  71 75 77 28 77 6f 72 64  |0 DEFFNequw(word|
00003970  29 0d 20 31 38 39 30 20  3f 50 25 3d 77 6f 72 64  |). 1890 ?P%=word|
00003980  20 4d 4f 44 20 32 35 36  0d 20 31 39 30 30 20 50  | MOD 256. 1900 P|
00003990  25 3f 31 3d 77 6f 72 64  20 44 49 56 20 32 35 36  |%?1=word DIV 256|
000039a0  0d 20 31 39 31 30 20 50  25 3d 50 25 2b 32 0d 20  |. 1910 P%=P%+2. |
000039b0  31 39 32 30 20 3d 70 61  73 73 0d 20 31 39 33 30  |1920 =pass. 1930|
000039c0  20 44 45 46 46 4e 65 71  75 64 28 64 6f 75 62 6c  | DEFFNequd(doubl|
000039d0  65 29 0d 20 31 39 34 30  20 21 50 25 3d 64 6f 75  |e). 1940 !P%=dou|
000039e0  62 6c 65 0d 20 31 39 35  30 20 50 25 3d 50 25 2b  |ble. 1950 P%=P%+|
000039f0  34 0d 20 31 39 36 30 20  3d 70 61 73 73 0d 20 31  |4. 1960 =pass. 1|
00003a00  39 37 30 20 44 45 46 46  4e 65 71 75 73 28 73 74  |970 DEFFNequs(st|
00003a10  72 69 6e 67 24 29 0d 20  31 39 38 30 20 24 50 25  |ring$). 1980 $P%|
00003a20  3d 73 74 72 69 6e 67 24  0d 20 31 39 39 30 20 50  |=string$. 1990 P|
00003a30  25 3d 50 25 2b 4c 45 4e  28 73 74 72 69 6e 67 24  |%=P%+LEN(string$|
00003a40  29 0d 20 32 30 30 30 20  3d 70 61 73 73 0d        |). 2000 =pass.|
00003a4e
07-02-88/T\SWR15.m0
07-02-88/T\SWR15.m1
07-02-88/T\SWR15.m2
07-02-88/T\SWR15.m4
07-02-88/T\SWR15.m5