Home » CEEFAX disks » telesoftware6.adl » 28-03-88/T\SWR21

28-03-88/T\SWR21

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » CEEFAX disks » telesoftware6.adl
Filename: 28-03-88/T\SWR21
Read OK:
File size: 2530 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 21 - RFS language rom
-----------------------------------------------------------

  In Module 20 you were shown one way in which programs stored in the
RFS can be run with * commands. The programs used to demonstrate the
technique created a service rom image. In this module I will show you
how a language rom design can be used to achieve a similar effect.

  One reason why you might choose to implement an RFS language rom is
that it will enable you to design a so called turnkey system as well
as allow you to run the RFS software with a new * command. A turnkey
computer system is one which automatically runs custom software when
it is switched on.

  If you have a language rom in socket &0F, or in a battery backed-up
sideways ram socket &0F, then that rom image will be booted when the
computer is switched on and when Ctrl+Break is pressed. This is true
for all language roms in the highest priority rom socket but, if your
custom software is written in BASIC, you would normally have to
re-write your program as an independant machine code language to run
it in this way. Using an RFS language rom will allow you to use your
software in a turnkey system without translating it into an
independant machine code program.

  An RFS language rom can be used in socket &0F of the BBC B simply by
moving the other rom chips to make room for it. On the BBC B+ it is
necessary to alter link S13 (to the right of IC46) to give the highest
priority rom socket on the circuit board priority over BASIC. The RFS
language rom image can be configured as the start up language on the
Master by using the *CONFIGURE LANG <rom number> command.

  The RFS language rom can also be used in a lower priority socket
than BASIC when it will function like any other language rom and it
will be selected when called with *FX142,n or its * command.

  In the program RFSERV the interpreter passed control to a service
routine which selected the RFS, stored a Chain command in the keyboard
buffer, and then entered BASIC which executed the command in the
keyboard buffer. The program RFSLANG achieves the same result by
entering a language which eventually executes the same coding used by
the service routine in RFSERV.

  The one command interpreter is used in the program RFSLANG to
compare an unrecognised command with the title string of the rom. If a
match is found the rom uses Osbyte &8E to enter the rom at its
language entry point. When the rom is entered at its language entry
point it must first enable interupts, reset the stack, and re-vector
the break vector to point to an error handling routine (see module
17). The complete language coding from RFSLANG is shown in figure 21.1





.language
        CLI                  \ enable interupt requests
        LDX #&FF
        TXS                  \ reset stack
        LDA #basic MOD 256   \ low byte of enter BASIC address
        STA &202             \ store in Break vector low byte
        LDA #basic DIV 256   \ high byte of enter BASIC address
        STA &203             \ store in Break vector high byte
        LDA #&8D             \ Osbyte &8D
        JSR &FFF4            \ *ROM
        LDA #&8B             \ Osbyte &8B
        LDX #1
        LDY #0
        JSR &FFF4            \ *OPT 1,0
        LDA #&0F             \ Osbyte &0F
        LDX #0
        JSR &FFF4            \ flush all buffers
        LDA #&FF             \ initialise offset
        PHA                  \ store offset
.keyboard
        PLA                  \ restore offset
        TAX                  \ transfer offset to X
        INX                  \ increment offset
        TXA                  \ copy offset to A
        PHA                  \ store offset
        LDY rfscomm,X        \ load character
        BEQ basic            \ branch if end of text character
        LDA #&8A             \ Osbyte &8A
        LDX #0
        JSR &FFF4            \ character into keyboard buffer
        JMP keyboard         \ go for next character
.basic
        LDA #&BB             \ Osbyte &BB
        LDX #0
        LDY #&FF
        JSR &FFF4            \ find BASIC
        LDA #&8E             \ Osbyte &8E
        JMP &FFF4            \ enter BASIC no return
         .
         .
         .
.rfscomm
        EQUS "CHAIN""DEMO""" \ chain command for BASIC
        EQUB &0D             \ <Return>
        BRK                  \ end of text marker

Figure 21.1  The language coding from RFSLANG.
-----------  ---------------------------------



  The break vector in RFSLANG points to the code which finds and
enters BASIC so that, if an error is generated while the language is
active, it responds by entering BASIC. The language defined by RFSLANG
will only ever be active for a few milli-seconds before it selects
BASIC to replace it and generating an error is quite unlikely. I have
been unable to generate an error within the language when testing the
program. This short cut method of dealing with errors by ignoring them
means that the rom will need to be re-booted if they occur.

  After initialising the language the coding does the same job as the
service routine in RFSERV. It selects the RFS, inserts the Chain
command into the keyboard buffer, and finds and enters BASIC. When
BASIC is entered in this way it executes the command in the keyboard
buffer and chains the file from the RFS.

  The program RFSLANG must be used with the formatting program RFSGEN
and whatever programs you want to store in the RFS. These programs are
used to create the RFS rom image and detailed instructions on using
them were included in Module 18. RFSLANG was written to be used with
the supplied demonstration program DEMO. If you want to use it with
any other program you will need to alter the command string in lines
1310 to 1330. You can also alter the rom title string in line 220 if
you would prefer to select the language with a command other than
*RFS.




   10 REM: RFSLANG
   20 MODE7
   30 HIMEM=&3C00
   40 diff=&8000-HIMEM
   50 H%=HIMEM
   60 comvec=&F2
   70 romnumber=&F4
   80 phrom=&F5
   90 rompoint=&F6
  100 breakv=&202
  110 gsread=&FFC5
  120 osbyte=&FFF4
  130 FOR pass = 0 TO 2 STEP 2
  140 P%=HIMEM
  150 [       OPT pass
  160         JMP language+diff
  170         JMP service+diff
  180         OPT FNequb(&C2)
  190         OPT FNequb((copyright+diff) MOD 256)
  200         BRK
  210 .title
  220         OPT FNequs("RFS")
  230 .copyright
  240         BRK
  250         OPT FNequs("(C) Gordon Horsington 1987")
  260         BRK
  270 .service
  280         PHA
  290         CMP #4
  300         BNE trythirteen
  310         TXA
  320         PHA
  330         TYA
  340         PHA
  350         LDX #&FF
  360 .comloop
  370         INX
  380         LDA title+diff,X
  390         BEQ found
  400         LDA (comvec),Y
  410         INY
  420         CMP #ASC(".")
  430         BEQ found
  440         AND #&DF
  450         CMP title+diff,X
  460         BEQ comloop
  470         PLA
  480         TAY
  490         PLA
  500         TAX
  510         PLA
  520         RTS
  530 .found
  540         LDA #&8E
  550         LDX romnumber
  560         JMP osbyte    \ Enter this ROM
  570 .trythirteen
  580         CMP #13
  590         BNE fourteen
  600         TYA
  610         EOR #&F
  620         CMP romnumber
  630         BCC out
  640         LDA #(lastbyte+diff) MOD 256
  650         STA rompoint
  660         LDA #(lastbyte+diff) DIV 256
  670         STA rompoint+1
  680         LDA romnumber
  690         EOR #&F
  700         STA phrom
  710 .exit
  720         PLA
  730         LDA #0
  740         RTS
  750 .fourteen
  760         CMP #14
  770         BNE out
  780         LDA phrom
  790         EOR #&F
  800         CMP romnumber
  810         BNE out
  820         LDY #0
  830         LDA (rompoint),Y
  840         TAY
  850         INC rompoint
  860         BNE exit
  870         INC rompoint+1
  880         JMP exit+diff
  890 .out
  900         PLA
  910         RTS
  920 .language
  930         CLI           \ Enable interupt requests
  940         LDX #&FF
  950         TXS           \ Reset stack
  960         LDA #(basic+diff) MOD 256
  970         STA breakv
  980         LDA #(basic+diff) DIV 256
  990         STA breakv+1
 1000         LDA #&8D
 1010         JSR osbyte    \ *ROM
 1020         LDA #&8B
 1030         LDX #1
 1040         LDY #0
 1050         JSR osbyte    \ *OPT1,0
 1060         LDA #&0F
 1070         LDX #0
 1080         JSR osbyte    \ Flush all buffers
 1090         LDA #&FF
 1100         PHA
 1110 .keyboard
 1120         PLA
 1130         TAX
 1140         INX
 1150         TXA
 1160         PHA
 1170         LDY rfscomm+diff,X
 1180         BEQ basic
 1190         LDA #&8A
 1200         LDX #0
 1210         JSR osbyte
 1220         JMP keyboard+diff
 1230 .basic
 1240         LDA #&BB
 1250         LDX #0
 1260         LDY #&FF
 1270         JSR osbyte    \ Find BASIC
 1280         LDA #&8E
 1290         JMP osbyte    \ Enter BASIC
 1300 .rfscomm
 1310         OPT FNequs("CHAIN""DEMO""")
 1320         OPT FNequb(&0D)
 1330         BRK
 1340 .lastbyte
 1350 ]
 1360 NEXT
 1370 O%=lastbyte
 1380 CHAIN"RFSGEN"
 1390 DEFFNequb(byte)
 1400 ?P%=byte
 1410 P%=P%+1
 1420 =pass
 1430 DEFFNequw(word)
 1440 ?P%=word MOD 256
 1450 P%?1=word DIV 256
 1460 P%=P%+2
 1470 =pass
 1480 DEFFNequd(double)
 1490 !P%=double
 1500 P%=P%+4
 1510 =pass
 1520 DEFFNequs(string$)
 1530 $P%=string$
 1540 P%=P%+LEN(string$)
 1550 =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 32 31  20 2d 20 52 46 53 20 6c  |odule 21 - RFS l|
00000030  61 6e 67 75 61 67 65 20  72 6f 6d 0d 2d 2d 2d 2d  |anguage rom.----|
00000040  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000070  2d 2d 2d 2d 2d 2d 2d 0d  0d 20 20 49 6e 20 4d 6f  |-------..  In Mo|
00000080  64 75 6c 65 20 32 30 20  79 6f 75 20 77 65 72 65  |dule 20 you were|
00000090  20 73 68 6f 77 6e 20 6f  6e 65 20 77 61 79 20 69  | shown one way i|
000000a0  6e 20 77 68 69 63 68 20  70 72 6f 67 72 61 6d 73  |n which programs|
000000b0  20 73 74 6f 72 65 64 20  69 6e 20 74 68 65 0d 52  | stored in the.R|
000000c0  46 53 20 63 61 6e 20 62  65 20 72 75 6e 20 77 69  |FS can be run wi|
000000d0  74 68 20 2a 20 63 6f 6d  6d 61 6e 64 73 2e 20 54  |th * commands. T|
000000e0  68 65 20 70 72 6f 67 72  61 6d 73 20 75 73 65 64  |he programs used|
000000f0  20 74 6f 20 64 65 6d 6f  6e 73 74 72 61 74 65 20  | to demonstrate |
00000100  74 68 65 0d 74 65 63 68  6e 69 71 75 65 20 63 72  |the.technique cr|
00000110  65 61 74 65 64 20 61 20  73 65 72 76 69 63 65 20  |eated a service |
00000120  72 6f 6d 20 69 6d 61 67  65 2e 20 49 6e 20 74 68  |rom image. In th|
00000130  69 73 20 6d 6f 64 75 6c  65 20 49 20 77 69 6c 6c  |is module I will|
00000140  20 73 68 6f 77 20 79 6f  75 0d 68 6f 77 20 61 20  | show you.how a |
00000150  6c 61 6e 67 75 61 67 65  20 72 6f 6d 20 64 65 73  |language rom des|
00000160  69 67 6e 20 63 61 6e 20  62 65 20 75 73 65 64 20  |ign can be used |
00000170  74 6f 20 61 63 68 69 65  76 65 20 61 20 73 69 6d  |to achieve a sim|
00000180  69 6c 61 72 20 65 66 66  65 63 74 2e 0d 0d 20 20  |ilar effect...  |
00000190  4f 6e 65 20 72 65 61 73  6f 6e 20 77 68 79 20 79  |One reason why y|
000001a0  6f 75 20 6d 69 67 68 74  20 63 68 6f 6f 73 65 20  |ou might choose |
000001b0  74 6f 20 69 6d 70 6c 65  6d 65 6e 74 20 61 6e 20  |to implement an |
000001c0  52 46 53 20 6c 61 6e 67  75 61 67 65 20 72 6f 6d  |RFS language rom|
000001d0  20 69 73 0d 74 68 61 74  20 69 74 20 77 69 6c 6c  | is.that it will|
000001e0  20 65 6e 61 62 6c 65 20  79 6f 75 20 74 6f 20 64  | enable you to d|
000001f0  65 73 69 67 6e 20 61 20  73 6f 20 63 61 6c 6c 65  |esign a so calle|
00000200  64 20 74 75 72 6e 6b 65  79 20 73 79 73 74 65 6d  |d turnkey system|
00000210  20 61 73 20 77 65 6c 6c  0d 61 73 20 61 6c 6c 6f  | as well.as allo|
00000220  77 20 79 6f 75 20 74 6f  20 72 75 6e 20 74 68 65  |w you to run the|
00000230  20 52 46 53 20 73 6f 66  74 77 61 72 65 20 77 69  | RFS software wi|
00000240  74 68 20 61 20 6e 65 77  20 2a 20 63 6f 6d 6d 61  |th a new * comma|
00000250  6e 64 2e 20 41 20 74 75  72 6e 6b 65 79 0d 63 6f  |nd. A turnkey.co|
00000260  6d 70 75 74 65 72 20 73  79 73 74 65 6d 20 69 73  |mputer system is|
00000270  20 6f 6e 65 20 77 68 69  63 68 20 61 75 74 6f 6d  | one which autom|
00000280  61 74 69 63 61 6c 6c 79  20 72 75 6e 73 20 63 75  |atically runs cu|
00000290  73 74 6f 6d 20 73 6f 66  74 77 61 72 65 20 77 68  |stom software wh|
000002a0  65 6e 0d 69 74 20 69 73  20 73 77 69 74 63 68 65  |en.it is switche|
000002b0  64 20 6f 6e 2e 0d 0d 20  20 49 66 20 79 6f 75 20  |d on...  If you |
000002c0  68 61 76 65 20 61 20 6c  61 6e 67 75 61 67 65 20  |have a language |
000002d0  72 6f 6d 20 69 6e 20 73  6f 63 6b 65 74 20 26 30  |rom in socket &0|
000002e0  46 2c 20 6f 72 20 69 6e  20 61 20 62 61 74 74 65  |F, or in a batte|
000002f0  72 79 20 62 61 63 6b 65  64 2d 75 70 0d 73 69 64  |ry backed-up.sid|
00000300  65 77 61 79 73 20 72 61  6d 20 73 6f 63 6b 65 74  |eways ram socket|
00000310  20 26 30 46 2c 20 74 68  65 6e 20 74 68 61 74 20  | &0F, then that |
00000320  72 6f 6d 20 69 6d 61 67  65 20 77 69 6c 6c 20 62  |rom image will b|
00000330  65 20 62 6f 6f 74 65 64  20 77 68 65 6e 20 74 68  |e booted when th|
00000340  65 0d 63 6f 6d 70 75 74  65 72 20 69 73 20 73 77  |e.computer is sw|
00000350  69 74 63 68 65 64 20 6f  6e 20 61 6e 64 20 77 68  |itched on and wh|
00000360  65 6e 20 43 74 72 6c 2b  42 72 65 61 6b 20 69 73  |en Ctrl+Break is|
00000370  20 70 72 65 73 73 65 64  2e 20 54 68 69 73 20 69  | pressed. This i|
00000380  73 20 74 72 75 65 0d 66  6f 72 20 61 6c 6c 20 6c  |s true.for all l|
00000390  61 6e 67 75 61 67 65 20  72 6f 6d 73 20 69 6e 20  |anguage roms in |
000003a0  74 68 65 20 68 69 67 68  65 73 74 20 70 72 69 6f  |the highest prio|
000003b0  72 69 74 79 20 72 6f 6d  20 73 6f 63 6b 65 74 20  |rity rom socket |
000003c0  62 75 74 2c 20 69 66 20  79 6f 75 72 0d 63 75 73  |but, if your.cus|
000003d0  74 6f 6d 20 73 6f 66 74  77 61 72 65 20 69 73 20  |tom software is |
000003e0  77 72 69 74 74 65 6e 20  69 6e 20 42 41 53 49 43  |written in BASIC|
000003f0  2c 20 79 6f 75 20 77 6f  75 6c 64 20 6e 6f 72 6d  |, you would norm|
00000400  61 6c 6c 79 20 68 61 76  65 20 74 6f 0d 72 65 2d  |ally have to.re-|
00000410  77 72 69 74 65 20 79 6f  75 72 20 70 72 6f 67 72  |write your progr|
00000420  61 6d 20 61 73 20 61 6e  20 69 6e 64 65 70 65 6e  |am as an indepen|
00000430  64 61 6e 74 20 6d 61 63  68 69 6e 65 20 63 6f 64  |dant machine cod|
00000440  65 20 6c 61 6e 67 75 61  67 65 20 74 6f 20 72 75  |e language to ru|
00000450  6e 0d 69 74 20 69 6e 20  74 68 69 73 20 77 61 79  |n.it in this way|
00000460  2e 20 55 73 69 6e 67 20  61 6e 20 52 46 53 20 6c  |. Using an RFS l|
00000470  61 6e 67 75 61 67 65 20  72 6f 6d 20 77 69 6c 6c  |anguage rom will|
00000480  20 61 6c 6c 6f 77 20 79  6f 75 20 74 6f 20 75 73  | allow you to us|
00000490  65 20 79 6f 75 72 0d 73  6f 66 74 77 61 72 65 20  |e your.software |
000004a0  69 6e 20 61 20 74 75 72  6e 6b 65 79 20 73 79 73  |in a turnkey sys|
000004b0  74 65 6d 20 77 69 74 68  6f 75 74 20 74 72 61 6e  |tem without tran|
000004c0  73 6c 61 74 69 6e 67 20  69 74 20 69 6e 74 6f 20  |slating it into |
000004d0  61 6e 0d 69 6e 64 65 70  65 6e 64 61 6e 74 20 6d  |an.independant m|
000004e0  61 63 68 69 6e 65 20 63  6f 64 65 20 70 72 6f 67  |achine code prog|
000004f0  72 61 6d 2e 0d 0d 20 20  41 6e 20 52 46 53 20 6c  |ram...  An RFS l|
00000500  61 6e 67 75 61 67 65 20  72 6f 6d 20 63 61 6e 20  |anguage rom can |
00000510  62 65 20 75 73 65 64 20  69 6e 20 73 6f 63 6b 65  |be used in socke|
00000520  74 20 26 30 46 20 6f 66  20 74 68 65 20 42 42 43  |t &0F of the BBC|
00000530  20 42 20 73 69 6d 70 6c  79 20 62 79 0d 6d 6f 76  | B simply by.mov|
00000540  69 6e 67 20 74 68 65 20  6f 74 68 65 72 20 72 6f  |ing the other ro|
00000550  6d 20 63 68 69 70 73 20  74 6f 20 6d 61 6b 65 20  |m chips to make |
00000560  72 6f 6f 6d 20 66 6f 72  20 69 74 2e 20 4f 6e 20  |room for it. On |
00000570  74 68 65 20 42 42 43 20  42 2b 20 69 74 20 69 73  |the BBC B+ it is|
00000580  0d 6e 65 63 65 73 73 61  72 79 20 74 6f 20 61 6c  |.necessary to al|
00000590  74 65 72 20 6c 69 6e 6b  20 53 31 33 20 28 74 6f  |ter link S13 (to|
000005a0  20 74 68 65 20 72 69 67  68 74 20 6f 66 20 49 43  | the right of IC|
000005b0  34 36 29 20 74 6f 20 67  69 76 65 20 74 68 65 20  |46) to give the |
000005c0  68 69 67 68 65 73 74 0d  70 72 69 6f 72 69 74 79  |highest.priority|
000005d0  20 72 6f 6d 20 73 6f 63  6b 65 74 20 6f 6e 20 74  | rom socket on t|
000005e0  68 65 20 63 69 72 63 75  69 74 20 62 6f 61 72 64  |he circuit board|
000005f0  20 70 72 69 6f 72 69 74  79 20 6f 76 65 72 20 42  | priority over B|
00000600  41 53 49 43 2e 20 54 68  65 20 52 46 53 0d 6c 61  |ASIC. The RFS.la|
00000610  6e 67 75 61 67 65 20 72  6f 6d 20 69 6d 61 67 65  |nguage rom image|
00000620  20 63 61 6e 20 62 65 20  63 6f 6e 66 69 67 75 72  | can be configur|
00000630  65 64 20 61 73 20 74 68  65 20 73 74 61 72 74 20  |ed as the start |
00000640  75 70 20 6c 61 6e 67 75  61 67 65 20 6f 6e 20 74  |up language on t|
00000650  68 65 0d 4d 61 73 74 65  72 20 62 79 20 75 73 69  |he.Master by usi|
00000660  6e 67 20 74 68 65 20 2a  43 4f 4e 46 49 47 55 52  |ng the *CONFIGUR|
00000670  45 20 4c 41 4e 47 20 3c  72 6f 6d 20 6e 75 6d 62  |E LANG <rom numb|
00000680  65 72 3e 20 63 6f 6d 6d  61 6e 64 2e 0d 0d 20 20  |er> command...  |
00000690  54 68 65 20 52 46 53 20  6c 61 6e 67 75 61 67 65  |The RFS language|
000006a0  20 72 6f 6d 20 63 61 6e  20 61 6c 73 6f 20 62 65  | rom can also be|
000006b0  20 75 73 65 64 20 69 6e  20 61 20 6c 6f 77 65 72  | used in a lower|
000006c0  20 70 72 69 6f 72 69 74  79 20 73 6f 63 6b 65 74  | priority socket|
000006d0  0d 74 68 61 6e 20 42 41  53 49 43 20 77 68 65 6e  |.than BASIC when|
000006e0  20 69 74 20 77 69 6c 6c  20 66 75 6e 63 74 69 6f  | it will functio|
000006f0  6e 20 6c 69 6b 65 20 61  6e 79 20 6f 74 68 65 72  |n like any other|
00000700  20 6c 61 6e 67 75 61 67  65 20 72 6f 6d 20 61 6e  | language rom an|
00000710  64 20 69 74 0d 77 69 6c  6c 20 62 65 20 73 65 6c  |d it.will be sel|
00000720  65 63 74 65 64 20 77 68  65 6e 20 63 61 6c 6c 65  |ected when calle|
00000730  64 20 77 69 74 68 20 2a  46 58 31 34 32 2c 6e 20  |d with *FX142,n |
00000740  6f 72 20 69 74 73 20 2a  20 63 6f 6d 6d 61 6e 64  |or its * command|
00000750  2e 0d 0d 20 20 49 6e 20  74 68 65 20 70 72 6f 67  |...  In the prog|
00000760  72 61 6d 20 52 46 53 45  52 56 20 74 68 65 20 69  |ram RFSERV the i|
00000770  6e 74 65 72 70 72 65 74  65 72 20 70 61 73 73 65  |nterpreter passe|
00000780  64 20 63 6f 6e 74 72 6f  6c 20 74 6f 20 61 20 73  |d control to a s|
00000790  65 72 76 69 63 65 0d 72  6f 75 74 69 6e 65 20 77  |ervice.routine w|
000007a0  68 69 63 68 20 73 65 6c  65 63 74 65 64 20 74 68  |hich selected th|
000007b0  65 20 52 46 53 2c 20 73  74 6f 72 65 64 20 61 20  |e RFS, stored a |
000007c0  43 68 61 69 6e 20 63 6f  6d 6d 61 6e 64 20 69 6e  |Chain command in|
000007d0  20 74 68 65 20 6b 65 79  62 6f 61 72 64 0d 62 75  | the keyboard.bu|
000007e0  66 66 65 72 2c 20 61 6e  64 20 74 68 65 6e 20 65  |ffer, and then e|
000007f0  6e 74 65 72 65 64 20 42  41 53 49 43 20 77 68 69  |ntered BASIC whi|
00000800  63 68 20 65 78 65 63 75  74 65 64 20 74 68 65 20  |ch executed the |
00000810  63 6f 6d 6d 61 6e 64 20  69 6e 20 74 68 65 0d 6b  |command in the.k|
00000820  65 79 62 6f 61 72 64 20  62 75 66 66 65 72 2e 20  |eyboard buffer. |
00000830  54 68 65 20 70 72 6f 67  72 61 6d 20 52 46 53 4c  |The program RFSL|
00000840  41 4e 47 20 61 63 68 69  65 76 65 73 20 74 68 65  |ANG achieves the|
00000850  20 73 61 6d 65 20 72 65  73 75 6c 74 20 62 79 0d  | same result by.|
00000860  65 6e 74 65 72 69 6e 67  20 61 20 6c 61 6e 67 75  |entering a langu|
00000870  61 67 65 20 77 68 69 63  68 20 65 76 65 6e 74 75  |age which eventu|
00000880  61 6c 6c 79 20 65 78 65  63 75 74 65 73 20 74 68  |ally executes th|
00000890  65 20 73 61 6d 65 20 63  6f 64 69 6e 67 20 75 73  |e same coding us|
000008a0  65 64 20 62 79 0d 74 68  65 20 73 65 72 76 69 63  |ed by.the servic|
000008b0  65 20 72 6f 75 74 69 6e  65 20 69 6e 20 52 46 53  |e routine in RFS|
000008c0  45 52 56 2e 0d 0d 20 20  54 68 65 20 6f 6e 65 20  |ERV...  The one |
000008d0  63 6f 6d 6d 61 6e 64 20  69 6e 74 65 72 70 72 65  |command interpre|
000008e0  74 65 72 20 69 73 20 75  73 65 64 20 69 6e 20 74  |ter is used in t|
000008f0  68 65 20 70 72 6f 67 72  61 6d 20 52 46 53 4c 41  |he program RFSLA|
00000900  4e 47 20 74 6f 0d 63 6f  6d 70 61 72 65 20 61 6e  |NG to.compare an|
00000910  20 75 6e 72 65 63 6f 67  6e 69 73 65 64 20 63 6f  | unrecognised co|
00000920  6d 6d 61 6e 64 20 77 69  74 68 20 74 68 65 20 74  |mmand with the t|
00000930  69 74 6c 65 20 73 74 72  69 6e 67 20 6f 66 20 74  |itle string of t|
00000940  68 65 20 72 6f 6d 2e 20  49 66 20 61 0d 6d 61 74  |he rom. If a.mat|
00000950  63 68 20 69 73 20 66 6f  75 6e 64 20 74 68 65 20  |ch is found the |
00000960  72 6f 6d 20 75 73 65 73  20 4f 73 62 79 74 65 20  |rom uses Osbyte |
00000970  26 38 45 20 74 6f 20 65  6e 74 65 72 20 74 68 65  |&8E to enter the|
00000980  20 72 6f 6d 20 61 74 20  69 74 73 0d 6c 61 6e 67  | rom at its.lang|
00000990  75 61 67 65 20 65 6e 74  72 79 20 70 6f 69 6e 74  |uage entry point|
000009a0  2e 20 57 68 65 6e 20 74  68 65 20 72 6f 6d 20 69  |. When the rom i|
000009b0  73 20 65 6e 74 65 72 65  64 20 61 74 20 69 74 73  |s entered at its|
000009c0  20 6c 61 6e 67 75 61 67  65 20 65 6e 74 72 79 0d  | language entry.|
000009d0  70 6f 69 6e 74 20 69 74  20 6d 75 73 74 20 66 69  |point it must fi|
000009e0  72 73 74 20 65 6e 61 62  6c 65 20 69 6e 74 65 72  |rst enable inter|
000009f0  75 70 74 73 2c 20 72 65  73 65 74 20 74 68 65 20  |upts, reset the |
00000a00  73 74 61 63 6b 2c 20 61  6e 64 20 72 65 2d 76 65  |stack, and re-ve|
00000a10  63 74 6f 72 0d 74 68 65  20 62 72 65 61 6b 20 76  |ctor.the break v|
00000a20  65 63 74 6f 72 20 74 6f  20 70 6f 69 6e 74 20 74  |ector to point t|
00000a30  6f 20 61 6e 20 65 72 72  6f 72 20 68 61 6e 64 6c  |o an error handl|
00000a40  69 6e 67 20 72 6f 75 74  69 6e 65 20 28 73 65 65  |ing routine (see|
00000a50  20 6d 6f 64 75 6c 65 0d  31 37 29 2e 20 54 68 65  | module.17). The|
00000a60  20 63 6f 6d 70 6c 65 74  65 20 6c 61 6e 67 75 61  | complete langua|
00000a70  67 65 20 63 6f 64 69 6e  67 20 66 72 6f 6d 20 52  |ge coding from R|
00000a80  46 53 4c 41 4e 47 20 69  73 20 73 68 6f 77 6e 20  |FSLANG is shown |
00000a90  69 6e 20 66 69 67 75 72  65 20 32 31 2e 31 0d 0d  |in figure 21.1..|
00000aa0  0d 0d 0d 0d 2e 6c 61 6e  67 75 61 67 65 0d 20 20  |.....language.  |
00000ab0  20 20 20 20 20 20 43 4c  49 20 20 20 20 20 20 20  |      CLI       |
00000ac0  20 20 20 20 20 20 20 20  20 20 20 5c 20 65 6e 61  |           \ ena|
00000ad0  62 6c 65 20 69 6e 74 65  72 75 70 74 20 72 65 71  |ble interupt req|
00000ae0  75 65 73 74 73 0d 20 20  20 20 20 20 20 20 4c 44  |uests.        LD|
00000af0  58 20 23 26 46 46 0d 20  20 20 20 20 20 20 20 54  |X #&FF.        T|
00000b00  58 53 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |XS              |
00000b10  20 20 20 20 5c 20 72 65  73 65 74 20 73 74 61 63  |    \ reset stac|
00000b20  6b 0d 20 20 20 20 20 20  20 20 4c 44 41 20 23 62  |k.        LDA #b|
00000b30  61 73 69 63 20 4d 4f 44  20 32 35 36 20 20 20 5c  |asic MOD 256   \|
00000b40  20 6c 6f 77 20 62 79 74  65 20 6f 66 20 65 6e 74  | low byte of ent|
00000b50  65 72 20 42 41 53 49 43  20 61 64 64 72 65 73 73  |er BASIC address|
00000b60  0d 20 20 20 20 20 20 20  20 53 54 41 20 26 32 30  |.        STA &20|
00000b70  32 20 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |2             \ |
00000b80  73 74 6f 72 65 20 69 6e  20 42 72 65 61 6b 20 76  |store in Break v|
00000b90  65 63 74 6f 72 20 6c 6f  77 20 62 79 74 65 0d 20  |ector low byte. |
00000ba0  20 20 20 20 20 20 20 4c  44 41 20 23 62 61 73 69  |       LDA #basi|
00000bb0  63 20 44 49 56 20 32 35  36 20 20 20 5c 20 68 69  |c DIV 256   \ hi|
00000bc0  67 68 20 62 79 74 65 20  6f 66 20 65 6e 74 65 72  |gh byte of enter|
00000bd0  20 42 41 53 49 43 20 61  64 64 72 65 73 73 0d 20  | BASIC address. |
00000be0  20 20 20 20 20 20 20 53  54 41 20 26 32 30 33 20  |       STA &203 |
00000bf0  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 73 74  |            \ st|
00000c00  6f 72 65 20 69 6e 20 42  72 65 61 6b 20 76 65 63  |ore in Break vec|
00000c10  74 6f 72 20 68 69 67 68  20 62 79 74 65 0d 20 20  |tor high byte.  |
00000c20  20 20 20 20 20 20 4c 44  41 20 23 26 38 44 20 20  |      LDA #&8D  |
00000c30  20 20 20 20 20 20 20 20  20 20 20 5c 20 4f 73 62  |           \ Osb|
00000c40  79 74 65 20 26 38 44 0d  20 20 20 20 20 20 20 20  |yte &8D.        |
00000c50  4a 53 52 20 26 46 46 46  34 20 20 20 20 20 20 20  |JSR &FFF4       |
00000c60  20 20 20 20 20 5c 20 2a  52 4f 4d 0d 20 20 20 20  |     \ *ROM.    |
00000c70  20 20 20 20 4c 44 41 20  23 26 38 42 20 20 20 20  |    LDA #&8B    |
00000c80  20 20 20 20 20 20 20 20  20 5c 20 4f 73 62 79 74  |         \ Osbyt|
00000c90  65 20 26 38 42 0d 20 20  20 20 20 20 20 20 4c 44  |e &8B.        LD|
00000ca0  58 20 23 31 0d 20 20 20  20 20 20 20 20 4c 44 59  |X #1.        LDY|
00000cb0  20 23 30 0d 20 20 20 20  20 20 20 20 4a 53 52 20  | #0.        JSR |
00000cc0  26 46 46 46 34 20 20 20  20 20 20 20 20 20 20 20  |&FFF4           |
00000cd0  20 5c 20 2a 4f 50 54 20  31 2c 30 0d 20 20 20 20  | \ *OPT 1,0.    |
00000ce0  20 20 20 20 4c 44 41 20  23 26 30 46 20 20 20 20  |    LDA #&0F    |
00000cf0  20 20 20 20 20 20 20 20  20 5c 20 4f 73 62 79 74  |         \ Osbyt|
00000d00  65 20 26 30 46 0d 20 20  20 20 20 20 20 20 4c 44  |e &0F.        LD|
00000d10  58 20 23 30 0d 20 20 20  20 20 20 20 20 4a 53 52  |X #0.        JSR|
00000d20  20 26 46 46 46 34 20 20  20 20 20 20 20 20 20 20  | &FFF4          |
00000d30  20 20 5c 20 66 6c 75 73  68 20 61 6c 6c 20 62 75  |  \ flush all bu|
00000d40  66 66 65 72 73 0d 20 20  20 20 20 20 20 20 4c 44  |ffers.        LD|
00000d50  41 20 23 26 46 46 20 20  20 20 20 20 20 20 20 20  |A #&FF          |
00000d60  20 20 20 5c 20 69 6e 69  74 69 61 6c 69 73 65 20  |   \ initialise |
00000d70  6f 66 66 73 65 74 0d 20  20 20 20 20 20 20 20 50  |offset.        P|
00000d80  48 41 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |HA              |
00000d90  20 20 20 20 5c 20 73 74  6f 72 65 20 6f 66 66 73  |    \ store offs|
00000da0  65 74 0d 2e 6b 65 79 62  6f 61 72 64 0d 20 20 20  |et..keyboard.   |
00000db0  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00000dc0  20 20 20 20 20 20 20 20  20 20 5c 20 72 65 73 74  |          \ rest|
00000dd0  6f 72 65 20 6f 66 66 73  65 74 0d 20 20 20 20 20  |ore offset.     |
00000de0  20 20 20 54 41 58 20 20  20 20 20 20 20 20 20 20  |   TAX          |
00000df0  20 20 20 20 20 20 20 20  5c 20 74 72 61 6e 73 66  |        \ transf|
00000e00  65 72 20 6f 66 66 73 65  74 20 74 6f 20 58 0d 20  |er offset to X. |
00000e10  20 20 20 20 20 20 20 49  4e 58 20 20 20 20 20 20  |       INX      |
00000e20  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 69 6e  |            \ in|
00000e30  63 72 65 6d 65 6e 74 20  6f 66 66 73 65 74 0d 20  |crement offset. |
00000e40  20 20 20 20 20 20 20 54  58 41 20 20 20 20 20 20  |       TXA      |
00000e50  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 63 6f  |            \ co|
00000e60  70 79 20 6f 66 66 73 65  74 20 74 6f 20 41 0d 20  |py offset to A. |
00000e70  20 20 20 20 20 20 20 50  48 41 20 20 20 20 20 20  |       PHA      |
00000e80  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 73 74  |            \ st|
00000e90  6f 72 65 20 6f 66 66 73  65 74 0d 20 20 20 20 20  |ore offset.     |
00000ea0  20 20 20 4c 44 59 20 72  66 73 63 6f 6d 6d 2c 58  |   LDY rfscomm,X|
00000eb0  20 20 20 20 20 20 20 20  5c 20 6c 6f 61 64 20 63  |        \ load c|
00000ec0  68 61 72 61 63 74 65 72  0d 20 20 20 20 20 20 20  |haracter.       |
00000ed0  20 42 45 51 20 62 61 73  69 63 20 20 20 20 20 20  | BEQ basic      |
00000ee0  20 20 20 20 20 20 5c 20  62 72 61 6e 63 68 20 69  |      \ branch i|
00000ef0  66 20 65 6e 64 20 6f 66  20 74 65 78 74 20 63 68  |f end of text ch|
00000f00  61 72 61 63 74 65 72 0d  20 20 20 20 20 20 20 20  |aracter.        |
00000f10  4c 44 41 20 23 26 38 41  20 20 20 20 20 20 20 20  |LDA #&8A        |
00000f20  20 20 20 20 20 5c 20 4f  73 62 79 74 65 20 26 38  |     \ Osbyte &8|
00000f30  41 0d 20 20 20 20 20 20  20 20 4c 44 58 20 23 30  |A.        LDX #0|
00000f40  0d 20 20 20 20 20 20 20  20 4a 53 52 20 26 46 46  |.        JSR &FF|
00000f50  46 34 20 20 20 20 20 20  20 20 20 20 20 20 5c 20  |F4            \ |
00000f60  63 68 61 72 61 63 74 65  72 20 69 6e 74 6f 20 6b  |character into k|
00000f70  65 79 62 6f 61 72 64 20  62 75 66 66 65 72 0d 20  |eyboard buffer. |
00000f80  20 20 20 20 20 20 20 4a  4d 50 20 6b 65 79 62 6f  |       JMP keybo|
00000f90  61 72 64 20 20 20 20 20  20 20 20 20 5c 20 67 6f  |ard         \ go|
00000fa0  20 66 6f 72 20 6e 65 78  74 20 63 68 61 72 61 63  | for next charac|
00000fb0  74 65 72 0d 2e 62 61 73  69 63 0d 20 20 20 20 20  |ter..basic.     |
00000fc0  20 20 20 4c 44 41 20 23  26 42 42 20 20 20 20 20  |   LDA #&BB     |
00000fd0  20 20 20 20 20 20 20 20  5c 20 4f 73 62 79 74 65  |        \ Osbyte|
00000fe0  20 26 42 42 0d 20 20 20  20 20 20 20 20 4c 44 58  | &BB.        LDX|
00000ff0  20 23 30 0d 20 20 20 20  20 20 20 20 4c 44 59 20  | #0.        LDY |
00001000  23 26 46 46 0d 20 20 20  20 20 20 20 20 4a 53 52  |#&FF.        JSR|
00001010  20 26 46 46 46 34 20 20  20 20 20 20 20 20 20 20  | &FFF4          |
00001020  20 20 5c 20 66 69 6e 64  20 42 41 53 49 43 0d 20  |  \ find BASIC. |
00001030  20 20 20 20 20 20 20 4c  44 41 20 23 26 38 45 20  |       LDA #&8E |
00001040  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 4f 73  |            \ Os|
00001050  62 79 74 65 20 26 38 45  0d 20 20 20 20 20 20 20  |byte &8E.       |
00001060  20 4a 4d 50 20 26 46 46  46 34 20 20 20 20 20 20  | JMP &FFF4      |
00001070  20 20 20 20 20 20 5c 20  65 6e 74 65 72 20 42 41  |      \ enter BA|
00001080  53 49 43 20 6e 6f 20 72  65 74 75 72 6e 0d 20 20  |SIC no return.  |
00001090  20 20 20 20 20 20 20 2e  0d 20 20 20 20 20 20 20  |       ..       |
000010a0  20 20 2e 0d 20 20 20 20  20 20 20 20 20 2e 0d 2e  |  ..         ...|
000010b0  72 66 73 63 6f 6d 6d 0d  20 20 20 20 20 20 20 20  |rfscomm.        |
000010c0  45 51 55 53 20 22 43 48  41 49 4e 22 22 44 45 4d  |EQUS "CHAIN""DEM|
000010d0  4f 22 22 22 20 5c 20 63  68 61 69 6e 20 63 6f 6d  |O""" \ chain com|
000010e0  6d 61 6e 64 20 66 6f 72  20 42 41 53 49 43 0d 20  |mand for BASIC. |
000010f0  20 20 20 20 20 20 20 45  51 55 42 20 26 30 44 20  |       EQUB &0D |
00001100  20 20 20 20 20 20 20 20  20 20 20 20 5c 20 3c 52  |            \ <R|
00001110  65 74 75 72 6e 3e 0d 20  20 20 20 20 20 20 20 42  |eturn>.        B|
00001120  52 4b 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |RK              |
00001130  20 20 20 20 5c 20 65 6e  64 20 6f 66 20 74 65 78  |    \ end of tex|
00001140  74 20 6d 61 72 6b 65 72  0d 0d 46 69 67 75 72 65  |t marker..Figure|
00001150  20 32 31 2e 31 20 20 54  68 65 20 6c 61 6e 67 75  | 21.1  The langu|
00001160  61 67 65 20 63 6f 64 69  6e 67 20 66 72 6f 6d 20  |age coding from |
00001170  52 46 53 4c 41 4e 47 2e  0d 2d 2d 2d 2d 2d 2d 2d  |RFSLANG..-------|
00001180  2d 2d 2d 2d 20 20 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----  ----------|
00001190  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
000011a0  2d 2d 2d 2d 2d 2d 2d 0d  0d 0d 0d 20 20 54 68 65  |-------....  The|
000011b0  20 62 72 65 61 6b 20 76  65 63 74 6f 72 20 69 6e  | break vector in|
000011c0  20 52 46 53 4c 41 4e 47  20 70 6f 69 6e 74 73 20  | RFSLANG points |
000011d0  74 6f 20 74 68 65 20 63  6f 64 65 20 77 68 69 63  |to the code whic|
000011e0  68 20 66 69 6e 64 73 20  61 6e 64 0d 65 6e 74 65  |h finds and.ente|
000011f0  72 73 20 42 41 53 49 43  20 73 6f 20 74 68 61 74  |rs BASIC so that|
00001200  2c 20 69 66 20 61 6e 20  65 72 72 6f 72 20 69 73  |, if an error is|
00001210  20 67 65 6e 65 72 61 74  65 64 20 77 68 69 6c 65  | generated while|
00001220  20 74 68 65 20 6c 61 6e  67 75 61 67 65 20 69 73  | the language is|
00001230  0d 61 63 74 69 76 65 2c  20 69 74 20 72 65 73 70  |.active, it resp|
00001240  6f 6e 64 73 20 62 79 20  65 6e 74 65 72 69 6e 67  |onds by entering|
00001250  20 42 41 53 49 43 2e 20  54 68 65 20 6c 61 6e 67  | BASIC. The lang|
00001260  75 61 67 65 20 64 65 66  69 6e 65 64 20 62 79 20  |uage defined by |
00001270  52 46 53 4c 41 4e 47 0d  77 69 6c 6c 20 6f 6e 6c  |RFSLANG.will onl|
00001280  79 20 65 76 65 72 20 62  65 20 61 63 74 69 76 65  |y ever be active|
00001290  20 66 6f 72 20 61 20 66  65 77 20 6d 69 6c 6c 69  | for a few milli|
000012a0  2d 73 65 63 6f 6e 64 73  20 62 65 66 6f 72 65 20  |-seconds before |
000012b0  69 74 20 73 65 6c 65 63  74 73 0d 42 41 53 49 43  |it selects.BASIC|
000012c0  20 74 6f 20 72 65 70 6c  61 63 65 20 69 74 20 61  | to replace it a|
000012d0  6e 64 20 67 65 6e 65 72  61 74 69 6e 67 20 61 6e  |nd generating an|
000012e0  20 65 72 72 6f 72 20 69  73 20 71 75 69 74 65 20  | error is quite |
000012f0  75 6e 6c 69 6b 65 6c 79  2e 20 49 20 68 61 76 65  |unlikely. I have|
00001300  0d 62 65 65 6e 20 75 6e  61 62 6c 65 20 74 6f 20  |.been unable to |
00001310  67 65 6e 65 72 61 74 65  20 61 6e 20 65 72 72 6f  |generate an erro|
00001320  72 20 77 69 74 68 69 6e  20 74 68 65 20 6c 61 6e  |r within the lan|
00001330  67 75 61 67 65 20 77 68  65 6e 20 74 65 73 74 69  |guage when testi|
00001340  6e 67 20 74 68 65 0d 70  72 6f 67 72 61 6d 2e 20  |ng the.program. |
00001350  54 68 69 73 20 73 68 6f  72 74 20 63 75 74 20 6d  |This short cut m|
00001360  65 74 68 6f 64 20 6f 66  20 64 65 61 6c 69 6e 67  |ethod of dealing|
00001370  20 77 69 74 68 20 65 72  72 6f 72 73 20 62 79 20  | with errors by |
00001380  69 67 6e 6f 72 69 6e 67  20 74 68 65 6d 0d 6d 65  |ignoring them.me|
00001390  61 6e 73 20 74 68 61 74  20 74 68 65 20 72 6f 6d  |ans that the rom|
000013a0  20 77 69 6c 6c 20 6e 65  65 64 20 74 6f 20 62 65  | will need to be|
000013b0  20 72 65 2d 62 6f 6f 74  65 64 20 69 66 20 74 68  | re-booted if th|
000013c0  65 79 20 6f 63 63 75 72  2e 0d 0d 20 20 41 66 74  |ey occur...  Aft|
000013d0  65 72 20 69 6e 69 74 69  61 6c 69 73 69 6e 67 20  |er initialising |
000013e0  74 68 65 20 6c 61 6e 67  75 61 67 65 20 74 68 65  |the language the|
000013f0  20 63 6f 64 69 6e 67 20  64 6f 65 73 20 74 68 65  | coding does the|
00001400  20 73 61 6d 65 20 6a 6f  62 20 61 73 20 74 68 65  | same job as the|
00001410  0d 73 65 72 76 69 63 65  20 72 6f 75 74 69 6e 65  |.service routine|
00001420  20 69 6e 20 52 46 53 45  52 56 2e 20 49 74 20 73  | in RFSERV. It s|
00001430  65 6c 65 63 74 73 20 74  68 65 20 52 46 53 2c 20  |elects the RFS, |
00001440  69 6e 73 65 72 74 73 20  74 68 65 20 43 68 61 69  |inserts the Chai|
00001450  6e 0d 63 6f 6d 6d 61 6e  64 20 69 6e 74 6f 20 74  |n.command into t|
00001460  68 65 20 6b 65 79 62 6f  61 72 64 20 62 75 66 66  |he keyboard buff|
00001470  65 72 2c 20 61 6e 64 20  66 69 6e 64 73 20 61 6e  |er, and finds an|
00001480  64 20 65 6e 74 65 72 73  20 42 41 53 49 43 2e 20  |d enters BASIC. |
00001490  57 68 65 6e 0d 42 41 53  49 43 20 69 73 20 65 6e  |When.BASIC is en|
000014a0  74 65 72 65 64 20 69 6e  20 74 68 69 73 20 77 61  |tered in this wa|
000014b0  79 20 69 74 20 65 78 65  63 75 74 65 73 20 74 68  |y it executes th|
000014c0  65 20 63 6f 6d 6d 61 6e  64 20 69 6e 20 74 68 65  |e command in the|
000014d0  20 6b 65 79 62 6f 61 72  64 0d 62 75 66 66 65 72  | keyboard.buffer|
000014e0  20 61 6e 64 20 63 68 61  69 6e 73 20 74 68 65 20  | and chains the |
000014f0  66 69 6c 65 20 66 72 6f  6d 20 74 68 65 20 52 46  |file from the RF|
00001500  53 2e 0d 0d 20 20 54 68  65 20 70 72 6f 67 72 61  |S...  The progra|
00001510  6d 20 52 46 53 4c 41 4e  47 20 6d 75 73 74 20 62  |m RFSLANG must b|
00001520  65 20 75 73 65 64 20 77  69 74 68 20 74 68 65 20  |e used with the |
00001530  66 6f 72 6d 61 74 74 69  6e 67 20 70 72 6f 67 72  |formatting progr|
00001540  61 6d 20 52 46 53 47 45  4e 0d 61 6e 64 20 77 68  |am RFSGEN.and wh|
00001550  61 74 65 76 65 72 20 70  72 6f 67 72 61 6d 73 20  |atever programs |
00001560  79 6f 75 20 77 61 6e 74  20 74 6f 20 73 74 6f 72  |you want to stor|
00001570  65 20 69 6e 20 74 68 65  20 52 46 53 2e 20 54 68  |e in the RFS. Th|
00001580  65 73 65 20 70 72 6f 67  72 61 6d 73 20 61 72 65  |ese programs are|
00001590  0d 75 73 65 64 20 74 6f  20 63 72 65 61 74 65 20  |.used to create |
000015a0  74 68 65 20 52 46 53 20  72 6f 6d 20 69 6d 61 67  |the RFS rom imag|
000015b0  65 20 61 6e 64 20 64 65  74 61 69 6c 65 64 20 69  |e and detailed i|
000015c0  6e 73 74 72 75 63 74 69  6f 6e 73 20 6f 6e 20 75  |nstructions on u|
000015d0  73 69 6e 67 0d 74 68 65  6d 20 77 65 72 65 20 69  |sing.them were i|
000015e0  6e 63 6c 75 64 65 64 20  69 6e 20 4d 6f 64 75 6c  |ncluded in Modul|
000015f0  65 20 31 38 2e 20 52 46  53 4c 41 4e 47 20 77 61  |e 18. RFSLANG wa|
00001600  73 20 77 72 69 74 74 65  6e 20 74 6f 20 62 65 20  |s written to be |
00001610  75 73 65 64 20 77 69 74  68 0d 74 68 65 20 73 75  |used with.the su|
00001620  70 70 6c 69 65 64 20 64  65 6d 6f 6e 73 74 72 61  |pplied demonstra|
00001630  74 69 6f 6e 20 70 72 6f  67 72 61 6d 20 44 45 4d  |tion program DEM|
00001640  4f 2e 20 49 66 20 79 6f  75 20 77 61 6e 74 20 74  |O. If you want t|
00001650  6f 20 75 73 65 20 69 74  20 77 69 74 68 0d 61 6e  |o use it with.an|
00001660  79 20 6f 74 68 65 72 20  70 72 6f 67 72 61 6d 20  |y other program |
00001670  79 6f 75 20 77 69 6c 6c  20 6e 65 65 64 20 74 6f  |you will need to|
00001680  20 61 6c 74 65 72 20 74  68 65 20 63 6f 6d 6d 61  | alter the comma|
00001690  6e 64 20 73 74 72 69 6e  67 20 69 6e 20 6c 69 6e  |nd string in lin|
000016a0  65 73 0d 31 33 31 30 20  74 6f 20 31 33 33 30 2e  |es.1310 to 1330.|
000016b0  20 59 6f 75 20 63 61 6e  20 61 6c 73 6f 20 61 6c  | You can also al|
000016c0  74 65 72 20 74 68 65 20  72 6f 6d 20 74 69 74 6c  |ter the rom titl|
000016d0  65 20 73 74 72 69 6e 67  20 69 6e 20 6c 69 6e 65  |e string in line|
000016e0  20 32 32 30 20 69 66 0d  79 6f 75 20 77 6f 75 6c  | 220 if.you woul|
000016f0  64 20 70 72 65 66 65 72  20 74 6f 20 73 65 6c 65  |d prefer to sele|
00001700  63 74 20 74 68 65 20 6c  61 6e 67 75 61 67 65 20  |ct the language |
00001710  77 69 74 68 20 61 20 63  6f 6d 6d 61 6e 64 20 6f  |with a command o|
00001720  74 68 65 72 20 74 68 61  6e 0d 2a 52 46 53 2e 0d  |ther than.*RFS..|
00001730  0d 0d 0d 0d 20 20 20 31  30 20 52 45 4d 3a 20 52  |....   10 REM: R|
00001740  46 53 4c 41 4e 47 0d 20  20 20 32 30 20 4d 4f 44  |FSLANG.   20 MOD|
00001750  45 37 0d 20 20 20 33 30  20 48 49 4d 45 4d 3d 26  |E7.   30 HIMEM=&|
00001760  33 43 30 30 0d 20 20 20  34 30 20 64 69 66 66 3d  |3C00.   40 diff=|
00001770  26 38 30 30 30 2d 48 49  4d 45 4d 0d 20 20 20 35  |&8000-HIMEM.   5|
00001780  30 20 48 25 3d 48 49 4d  45 4d 0d 20 20 20 36 30  |0 H%=HIMEM.   60|
00001790  20 63 6f 6d 76 65 63 3d  26 46 32 0d 20 20 20 37  | comvec=&F2.   7|
000017a0  30 20 72 6f 6d 6e 75 6d  62 65 72 3d 26 46 34 0d  |0 romnumber=&F4.|
000017b0  20 20 20 38 30 20 70 68  72 6f 6d 3d 26 46 35 0d  |   80 phrom=&F5.|
000017c0  20 20 20 39 30 20 72 6f  6d 70 6f 69 6e 74 3d 26  |   90 rompoint=&|
000017d0  46 36 0d 20 20 31 30 30  20 62 72 65 61 6b 76 3d  |F6.  100 breakv=|
000017e0  26 32 30 32 0d 20 20 31  31 30 20 67 73 72 65 61  |&202.  110 gsrea|
000017f0  64 3d 26 46 46 43 35 0d  20 20 31 32 30 20 6f 73  |d=&FFC5.  120 os|
00001800  62 79 74 65 3d 26 46 46  46 34 0d 20 20 31 33 30  |byte=&FFF4.  130|
00001810  20 46 4f 52 20 70 61 73  73 20 3d 20 30 20 54 4f  | FOR pass = 0 TO|
00001820  20 32 20 53 54 45 50 20  32 0d 20 20 31 34 30 20  | 2 STEP 2.  140 |
00001830  50 25 3d 48 49 4d 45 4d  0d 20 20 31 35 30 20 5b  |P%=HIMEM.  150 [|
00001840  20 20 20 20 20 20 20 4f  50 54 20 70 61 73 73 0d  |       OPT pass.|
00001850  20 20 31 36 30 20 20 20  20 20 20 20 20 20 4a 4d  |  160         JM|
00001860  50 20 6c 61 6e 67 75 61  67 65 2b 64 69 66 66 0d  |P language+diff.|
00001870  20 20 31 37 30 20 20 20  20 20 20 20 20 20 4a 4d  |  170         JM|
00001880  50 20 73 65 72 76 69 63  65 2b 64 69 66 66 0d 20  |P service+diff. |
00001890  20 31 38 30 20 20 20 20  20 20 20 20 20 4f 50 54  | 180         OPT|
000018a0  20 46 4e 65 71 75 62 28  26 43 32 29 0d 20 20 31  | FNequb(&C2).  1|
000018b0  39 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |90         OPT F|
000018c0  4e 65 71 75 62 28 28 63  6f 70 79 72 69 67 68 74  |Nequb((copyright|
000018d0  2b 64 69 66 66 29 20 4d  4f 44 20 32 35 36 29 0d  |+diff) MOD 256).|
000018e0  20 20 32 30 30 20 20 20  20 20 20 20 20 20 42 52  |  200         BR|
000018f0  4b 0d 20 20 32 31 30 20  2e 74 69 74 6c 65 0d 20  |K.  210 .title. |
00001900  20 32 32 30 20 20 20 20  20 20 20 20 20 4f 50 54  | 220         OPT|
00001910  20 46 4e 65 71 75 73 28  22 52 46 53 22 29 0d 20  | FNequs("RFS"). |
00001920  20 32 33 30 20 2e 63 6f  70 79 72 69 67 68 74 0d  | 230 .copyright.|
00001930  20 20 32 34 30 20 20 20  20 20 20 20 20 20 42 52  |  240         BR|
00001940  4b 0d 20 20 32 35 30 20  20 20 20 20 20 20 20 20  |K.  250         |
00001950  4f 50 54 20 46 4e 65 71  75 73 28 22 28 43 29 20  |OPT FNequs("(C) |
00001960  47 6f 72 64 6f 6e 20 48  6f 72 73 69 6e 67 74 6f  |Gordon Horsingto|
00001970  6e 20 31 39 38 37 22 29  0d 20 20 32 36 30 20 20  |n 1987").  260  |
00001980  20 20 20 20 20 20 20 42  52 4b 0d 20 20 32 37 30  |       BRK.  270|
00001990  20 2e 73 65 72 76 69 63  65 0d 20 20 32 38 30 20  | .service.  280 |
000019a0  20 20 20 20 20 20 20 20  50 48 41 0d 20 20 32 39  |        PHA.  29|
000019b0  30 20 20 20 20 20 20 20  20 20 43 4d 50 20 23 34  |0         CMP #4|
000019c0  0d 20 20 33 30 30 20 20  20 20 20 20 20 20 20 42  |.  300         B|
000019d0  4e 45 20 74 72 79 74 68  69 72 74 65 65 6e 0d 20  |NE trythirteen. |
000019e0  20 33 31 30 20 20 20 20  20 20 20 20 20 54 58 41  | 310         TXA|
000019f0  0d 20 20 33 32 30 20 20  20 20 20 20 20 20 20 50  |.  320         P|
00001a00  48 41 0d 20 20 33 33 30  20 20 20 20 20 20 20 20  |HA.  330        |
00001a10  20 54 59 41 0d 20 20 33  34 30 20 20 20 20 20 20  | TYA.  340      |
00001a20  20 20 20 50 48 41 0d 20  20 33 35 30 20 20 20 20  |   PHA.  350    |
00001a30  20 20 20 20 20 4c 44 58  20 23 26 46 46 0d 20 20  |     LDX #&FF.  |
00001a40  33 36 30 20 2e 63 6f 6d  6c 6f 6f 70 0d 20 20 33  |360 .comloop.  3|
00001a50  37 30 20 20 20 20 20 20  20 20 20 49 4e 58 0d 20  |70         INX. |
00001a60  20 33 38 30 20 20 20 20  20 20 20 20 20 4c 44 41  | 380         LDA|
00001a70  20 74 69 74 6c 65 2b 64  69 66 66 2c 58 0d 20 20  | title+diff,X.  |
00001a80  33 39 30 20 20 20 20 20  20 20 20 20 42 45 51 20  |390         BEQ |
00001a90  66 6f 75 6e 64 0d 20 20  34 30 30 20 20 20 20 20  |found.  400     |
00001aa0  20 20 20 20 4c 44 41 20  28 63 6f 6d 76 65 63 29  |    LDA (comvec)|
00001ab0  2c 59 0d 20 20 34 31 30  20 20 20 20 20 20 20 20  |,Y.  410        |
00001ac0  20 49 4e 59 0d 20 20 34  32 30 20 20 20 20 20 20  | INY.  420      |
00001ad0  20 20 20 43 4d 50 20 23  41 53 43 28 22 2e 22 29  |   CMP #ASC(".")|
00001ae0  0d 20 20 34 33 30 20 20  20 20 20 20 20 20 20 42  |.  430         B|
00001af0  45 51 20 66 6f 75 6e 64  0d 20 20 34 34 30 20 20  |EQ found.  440  |
00001b00  20 20 20 20 20 20 20 41  4e 44 20 23 26 44 46 0d  |       AND #&DF.|
00001b10  20 20 34 35 30 20 20 20  20 20 20 20 20 20 43 4d  |  450         CM|
00001b20  50 20 74 69 74 6c 65 2b  64 69 66 66 2c 58 0d 20  |P title+diff,X. |
00001b30  20 34 36 30 20 20 20 20  20 20 20 20 20 42 45 51  | 460         BEQ|
00001b40  20 63 6f 6d 6c 6f 6f 70  0d 20 20 34 37 30 20 20  | comloop.  470  |
00001b50  20 20 20 20 20 20 20 50  4c 41 0d 20 20 34 38 30  |       PLA.  480|
00001b60  20 20 20 20 20 20 20 20  20 54 41 59 0d 20 20 34  |         TAY.  4|
00001b70  39 30 20 20 20 20 20 20  20 20 20 50 4c 41 0d 20  |90         PLA. |
00001b80  20 35 30 30 20 20 20 20  20 20 20 20 20 54 41 58  | 500         TAX|
00001b90  0d 20 20 35 31 30 20 20  20 20 20 20 20 20 20 50  |.  510         P|
00001ba0  4c 41 0d 20 20 35 32 30  20 20 20 20 20 20 20 20  |LA.  520        |
00001bb0  20 52 54 53 0d 20 20 35  33 30 20 2e 66 6f 75 6e  | RTS.  530 .foun|
00001bc0  64 0d 20 20 35 34 30 20  20 20 20 20 20 20 20 20  |d.  540         |
00001bd0  4c 44 41 20 23 26 38 45  0d 20 20 35 35 30 20 20  |LDA #&8E.  550  |
00001be0  20 20 20 20 20 20 20 4c  44 58 20 72 6f 6d 6e 75  |       LDX romnu|
00001bf0  6d 62 65 72 0d 20 20 35  36 30 20 20 20 20 20 20  |mber.  560      |
00001c00  20 20 20 4a 4d 50 20 6f  73 62 79 74 65 20 20 20  |   JMP osbyte   |
00001c10  20 5c 20 45 6e 74 65 72  20 74 68 69 73 20 52 4f  | \ Enter this RO|
00001c20  4d 0d 20 20 35 37 30 20  2e 74 72 79 74 68 69 72  |M.  570 .trythir|
00001c30  74 65 65 6e 0d 20 20 35  38 30 20 20 20 20 20 20  |teen.  580      |
00001c40  20 20 20 43 4d 50 20 23  31 33 0d 20 20 35 39 30  |   CMP #13.  590|
00001c50  20 20 20 20 20 20 20 20  20 42 4e 45 20 66 6f 75  |         BNE fou|
00001c60  72 74 65 65 6e 0d 20 20  36 30 30 20 20 20 20 20  |rteen.  600     |
00001c70  20 20 20 20 54 59 41 0d  20 20 36 31 30 20 20 20  |    TYA.  610   |
00001c80  20 20 20 20 20 20 45 4f  52 20 23 26 46 0d 20 20  |      EOR #&F.  |
00001c90  36 32 30 20 20 20 20 20  20 20 20 20 43 4d 50 20  |620         CMP |
00001ca0  72 6f 6d 6e 75 6d 62 65  72 0d 20 20 36 33 30 20  |romnumber.  630 |
00001cb0  20 20 20 20 20 20 20 20  42 43 43 20 6f 75 74 0d  |        BCC out.|
00001cc0  20 20 36 34 30 20 20 20  20 20 20 20 20 20 4c 44  |  640         LD|
00001cd0  41 20 23 28 6c 61 73 74  62 79 74 65 2b 64 69 66  |A #(lastbyte+dif|
00001ce0  66 29 20 4d 4f 44 20 32  35 36 0d 20 20 36 35 30  |f) MOD 256.  650|
00001cf0  20 20 20 20 20 20 20 20  20 53 54 41 20 72 6f 6d  |         STA rom|
00001d00  70 6f 69 6e 74 0d 20 20  36 36 30 20 20 20 20 20  |point.  660     |
00001d10  20 20 20 20 4c 44 41 20  23 28 6c 61 73 74 62 79  |    LDA #(lastby|
00001d20  74 65 2b 64 69 66 66 29  20 44 49 56 20 32 35 36  |te+diff) DIV 256|
00001d30  0d 20 20 36 37 30 20 20  20 20 20 20 20 20 20 53  |.  670         S|
00001d40  54 41 20 72 6f 6d 70 6f  69 6e 74 2b 31 0d 20 20  |TA rompoint+1.  |
00001d50  36 38 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |680         LDA |
00001d60  72 6f 6d 6e 75 6d 62 65  72 0d 20 20 36 39 30 20  |romnumber.  690 |
00001d70  20 20 20 20 20 20 20 20  45 4f 52 20 23 26 46 0d  |        EOR #&F.|
00001d80  20 20 37 30 30 20 20 20  20 20 20 20 20 20 53 54  |  700         ST|
00001d90  41 20 70 68 72 6f 6d 0d  20 20 37 31 30 20 2e 65  |A phrom.  710 .e|
00001da0  78 69 74 0d 20 20 37 32  30 20 20 20 20 20 20 20  |xit.  720       |
00001db0  20 20 50 4c 41 0d 20 20  37 33 30 20 20 20 20 20  |  PLA.  730     |
00001dc0  20 20 20 20 4c 44 41 20  23 30 0d 20 20 37 34 30  |    LDA #0.  740|
00001dd0  20 20 20 20 20 20 20 20  20 52 54 53 0d 20 20 37  |         RTS.  7|
00001de0  35 30 20 2e 66 6f 75 72  74 65 65 6e 0d 20 20 37  |50 .fourteen.  7|
00001df0  36 30 20 20 20 20 20 20  20 20 20 43 4d 50 20 23  |60         CMP #|
00001e00  31 34 0d 20 20 37 37 30  20 20 20 20 20 20 20 20  |14.  770        |
00001e10  20 42 4e 45 20 6f 75 74  0d 20 20 37 38 30 20 20  | BNE out.  780  |
00001e20  20 20 20 20 20 20 20 4c  44 41 20 70 68 72 6f 6d  |       LDA phrom|
00001e30  0d 20 20 37 39 30 20 20  20 20 20 20 20 20 20 45  |.  790         E|
00001e40  4f 52 20 23 26 46 0d 20  20 38 30 30 20 20 20 20  |OR #&F.  800    |
00001e50  20 20 20 20 20 43 4d 50  20 72 6f 6d 6e 75 6d 62  |     CMP romnumb|
00001e60  65 72 0d 20 20 38 31 30  20 20 20 20 20 20 20 20  |er.  810        |
00001e70  20 42 4e 45 20 6f 75 74  0d 20 20 38 32 30 20 20  | BNE out.  820  |
00001e80  20 20 20 20 20 20 20 4c  44 59 20 23 30 0d 20 20  |       LDY #0.  |
00001e90  38 33 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |830         LDA |
00001ea0  28 72 6f 6d 70 6f 69 6e  74 29 2c 59 0d 20 20 38  |(rompoint),Y.  8|
00001eb0  34 30 20 20 20 20 20 20  20 20 20 54 41 59 0d 20  |40         TAY. |
00001ec0  20 38 35 30 20 20 20 20  20 20 20 20 20 49 4e 43  | 850         INC|
00001ed0  20 72 6f 6d 70 6f 69 6e  74 0d 20 20 38 36 30 20  | rompoint.  860 |
00001ee0  20 20 20 20 20 20 20 20  42 4e 45 20 65 78 69 74  |        BNE exit|
00001ef0  0d 20 20 38 37 30 20 20  20 20 20 20 20 20 20 49  |.  870         I|
00001f00  4e 43 20 72 6f 6d 70 6f  69 6e 74 2b 31 0d 20 20  |NC rompoint+1.  |
00001f10  38 38 30 20 20 20 20 20  20 20 20 20 4a 4d 50 20  |880         JMP |
00001f20  65 78 69 74 2b 64 69 66  66 0d 20 20 38 39 30 20  |exit+diff.  890 |
00001f30  2e 6f 75 74 0d 20 20 39  30 30 20 20 20 20 20 20  |.out.  900      |
00001f40  20 20 20 50 4c 41 0d 20  20 39 31 30 20 20 20 20  |   PLA.  910    |
00001f50  20 20 20 20 20 52 54 53  0d 20 20 39 32 30 20 2e  |     RTS.  920 .|
00001f60  6c 61 6e 67 75 61 67 65  0d 20 20 39 33 30 20 20  |language.  930  |
00001f70  20 20 20 20 20 20 20 43  4c 49 20 20 20 20 20 20  |       CLI      |
00001f80  20 20 20 20 20 5c 20 45  6e 61 62 6c 65 20 69 6e  |     \ Enable in|
00001f90  74 65 72 75 70 74 20 72  65 71 75 65 73 74 73 0d  |terupt requests.|
00001fa0  20 20 39 34 30 20 20 20  20 20 20 20 20 20 4c 44  |  940         LD|
00001fb0  58 20 23 26 46 46 0d 20  20 39 35 30 20 20 20 20  |X #&FF.  950    |
00001fc0  20 20 20 20 20 54 58 53  20 20 20 20 20 20 20 20  |     TXS        |
00001fd0  20 20 20 5c 20 52 65 73  65 74 20 73 74 61 63 6b  |   \ Reset stack|
00001fe0  0d 20 20 39 36 30 20 20  20 20 20 20 20 20 20 4c  |.  960         L|
00001ff0  44 41 20 23 28 62 61 73  69 63 2b 64 69 66 66 29  |DA #(basic+diff)|
00002000  20 4d 4f 44 20 32 35 36  0d 20 20 39 37 30 20 20  | MOD 256.  970  |
00002010  20 20 20 20 20 20 20 53  54 41 20 62 72 65 61 6b  |       STA break|
00002020  76 0d 20 20 39 38 30 20  20 20 20 20 20 20 20 20  |v.  980         |
00002030  4c 44 41 20 23 28 62 61  73 69 63 2b 64 69 66 66  |LDA #(basic+diff|
00002040  29 20 44 49 56 20 32 35  36 0d 20 20 39 39 30 20  |) DIV 256.  990 |
00002050  20 20 20 20 20 20 20 20  53 54 41 20 62 72 65 61  |        STA brea|
00002060  6b 76 2b 31 0d 20 31 30  30 30 20 20 20 20 20 20  |kv+1. 1000      |
00002070  20 20 20 4c 44 41 20 23  26 38 44 0d 20 31 30 31  |   LDA #&8D. 101|
00002080  30 20 20 20 20 20 20 20  20 20 4a 53 52 20 6f 73  |0         JSR os|
00002090  62 79 74 65 20 20 20 20  5c 20 2a 52 4f 4d 0d 20  |byte    \ *ROM. |
000020a0  31 30 32 30 20 20 20 20  20 20 20 20 20 4c 44 41  |1020         LDA|
000020b0  20 23 26 38 42 0d 20 31  30 33 30 20 20 20 20 20  | #&8B. 1030     |
000020c0  20 20 20 20 4c 44 58 20  23 31 0d 20 31 30 34 30  |    LDX #1. 1040|
000020d0  20 20 20 20 20 20 20 20  20 4c 44 59 20 23 30 0d  |         LDY #0.|
000020e0  20 31 30 35 30 20 20 20  20 20 20 20 20 20 4a 53  | 1050         JS|
000020f0  52 20 6f 73 62 79 74 65  20 20 20 20 5c 20 2a 4f  |R osbyte    \ *O|
00002100  50 54 31 2c 30 0d 20 31  30 36 30 20 20 20 20 20  |PT1,0. 1060     |
00002110  20 20 20 20 4c 44 41 20  23 26 30 46 0d 20 31 30  |    LDA #&0F. 10|
00002120  37 30 20 20 20 20 20 20  20 20 20 4c 44 58 20 23  |70         LDX #|
00002130  30 0d 20 31 30 38 30 20  20 20 20 20 20 20 20 20  |0. 1080         |
00002140  4a 53 52 20 6f 73 62 79  74 65 20 20 20 20 5c 20  |JSR osbyte    \ |
00002150  46 6c 75 73 68 20 61 6c  6c 20 62 75 66 66 65 72  |Flush all buffer|
00002160  73 0d 20 31 30 39 30 20  20 20 20 20 20 20 20 20  |s. 1090         |
00002170  4c 44 41 20 23 26 46 46  0d 20 31 31 30 30 20 20  |LDA #&FF. 1100  |
00002180  20 20 20 20 20 20 20 50  48 41 0d 20 31 31 31 30  |       PHA. 1110|
00002190  20 2e 6b 65 79 62 6f 61  72 64 0d 20 31 31 32 30  | .keyboard. 1120|
000021a0  20 20 20 20 20 20 20 20  20 50 4c 41 0d 20 31 31  |         PLA. 11|
000021b0  33 30 20 20 20 20 20 20  20 20 20 54 41 58 0d 20  |30         TAX. |
000021c0  31 31 34 30 20 20 20 20  20 20 20 20 20 49 4e 58  |1140         INX|
000021d0  0d 20 31 31 35 30 20 20  20 20 20 20 20 20 20 54  |. 1150         T|
000021e0  58 41 0d 20 31 31 36 30  20 20 20 20 20 20 20 20  |XA. 1160        |
000021f0  20 50 48 41 0d 20 31 31  37 30 20 20 20 20 20 20  | PHA. 1170      |
00002200  20 20 20 4c 44 59 20 72  66 73 63 6f 6d 6d 2b 64  |   LDY rfscomm+d|
00002210  69 66 66 2c 58 0d 20 31  31 38 30 20 20 20 20 20  |iff,X. 1180     |
00002220  20 20 20 20 42 45 51 20  62 61 73 69 63 0d 20 31  |    BEQ basic. 1|
00002230  31 39 30 20 20 20 20 20  20 20 20 20 4c 44 41 20  |190         LDA |
00002240  23 26 38 41 0d 20 31 32  30 30 20 20 20 20 20 20  |#&8A. 1200      |
00002250  20 20 20 4c 44 58 20 23  30 0d 20 31 32 31 30 20  |   LDX #0. 1210 |
00002260  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 62 79  |        JSR osby|
00002270  74 65 0d 20 31 32 32 30  20 20 20 20 20 20 20 20  |te. 1220        |
00002280  20 4a 4d 50 20 6b 65 79  62 6f 61 72 64 2b 64 69  | JMP keyboard+di|
00002290  66 66 0d 20 31 32 33 30  20 2e 62 61 73 69 63 0d  |ff. 1230 .basic.|
000022a0  20 31 32 34 30 20 20 20  20 20 20 20 20 20 4c 44  | 1240         LD|
000022b0  41 20 23 26 42 42 0d 20  31 32 35 30 20 20 20 20  |A #&BB. 1250    |
000022c0  20 20 20 20 20 4c 44 58  20 23 30 0d 20 31 32 36  |     LDX #0. 126|
000022d0  30 20 20 20 20 20 20 20  20 20 4c 44 59 20 23 26  |0         LDY #&|
000022e0  46 46 0d 20 31 32 37 30  20 20 20 20 20 20 20 20  |FF. 1270        |
000022f0  20 4a 53 52 20 6f 73 62  79 74 65 20 20 20 20 5c  | JSR osbyte    \|
00002300  20 46 69 6e 64 20 42 41  53 49 43 0d 20 31 32 38  | Find BASIC. 128|
00002310  30 20 20 20 20 20 20 20  20 20 4c 44 41 20 23 26  |0         LDA #&|
00002320  38 45 0d 20 31 32 39 30  20 20 20 20 20 20 20 20  |8E. 1290        |
00002330  20 4a 4d 50 20 6f 73 62  79 74 65 20 20 20 20 5c  | JMP osbyte    \|
00002340  20 45 6e 74 65 72 20 42  41 53 49 43 0d 20 31 33  | Enter BASIC. 13|
00002350  30 30 20 2e 72 66 73 63  6f 6d 6d 0d 20 31 33 31  |00 .rfscomm. 131|
00002360  30 20 20 20 20 20 20 20  20 20 4f 50 54 20 46 4e  |0         OPT FN|
00002370  65 71 75 73 28 22 43 48  41 49 4e 22 22 44 45 4d  |equs("CHAIN""DEM|
00002380  4f 22 22 22 29 0d 20 31  33 32 30 20 20 20 20 20  |O"""). 1320     |
00002390  20 20 20 20 4f 50 54 20  46 4e 65 71 75 62 28 26  |    OPT FNequb(&|
000023a0  30 44 29 0d 20 31 33 33  30 20 20 20 20 20 20 20  |0D). 1330       |
000023b0  20 20 42 52 4b 0d 20 31  33 34 30 20 2e 6c 61 73  |  BRK. 1340 .las|
000023c0  74 62 79 74 65 0d 20 31  33 35 30 20 5d 0d 20 31  |tbyte. 1350 ]. 1|
000023d0  33 36 30 20 4e 45 58 54  0d 20 31 33 37 30 20 4f  |360 NEXT. 1370 O|
000023e0  25 3d 6c 61 73 74 62 79  74 65 0d 20 31 33 38 30  |%=lastbyte. 1380|
000023f0  20 43 48 41 49 4e 22 52  46 53 47 45 4e 22 0d 20  | CHAIN"RFSGEN". |
00002400  31 33 39 30 20 44 45 46  46 4e 65 71 75 62 28 62  |1390 DEFFNequb(b|
00002410  79 74 65 29 0d 20 31 34  30 30 20 3f 50 25 3d 62  |yte). 1400 ?P%=b|
00002420  79 74 65 0d 20 31 34 31  30 20 50 25 3d 50 25 2b  |yte. 1410 P%=P%+|
00002430  31 0d 20 31 34 32 30 20  3d 70 61 73 73 0d 20 31  |1. 1420 =pass. 1|
00002440  34 33 30 20 44 45 46 46  4e 65 71 75 77 28 77 6f  |430 DEFFNequw(wo|
00002450  72 64 29 0d 20 31 34 34  30 20 3f 50 25 3d 77 6f  |rd). 1440 ?P%=wo|
00002460  72 64 20 4d 4f 44 20 32  35 36 0d 20 31 34 35 30  |rd MOD 256. 1450|
00002470  20 50 25 3f 31 3d 77 6f  72 64 20 44 49 56 20 32  | P%?1=word DIV 2|
00002480  35 36 0d 20 31 34 36 30  20 50 25 3d 50 25 2b 32  |56. 1460 P%=P%+2|
00002490  0d 20 31 34 37 30 20 3d  70 61 73 73 0d 20 31 34  |. 1470 =pass. 14|
000024a0  38 30 20 44 45 46 46 4e  65 71 75 64 28 64 6f 75  |80 DEFFNequd(dou|
000024b0  62 6c 65 29 0d 20 31 34  39 30 20 21 50 25 3d 64  |ble). 1490 !P%=d|
000024c0  6f 75 62 6c 65 0d 20 31  35 30 30 20 50 25 3d 50  |ouble. 1500 P%=P|
000024d0  25 2b 34 0d 20 31 35 31  30 20 3d 70 61 73 73 0d  |%+4. 1510 =pass.|
000024e0  20 31 35 32 30 20 44 45  46 46 4e 65 71 75 73 28  | 1520 DEFFNequs(|
000024f0  73 74 72 69 6e 67 24 29  0d 20 31 35 33 30 20 24  |string$). 1530 $|
00002500  50 25 3d 73 74 72 69 6e  67 24 0d 20 31 35 34 30  |P%=string$. 1540|
00002510  20 50 25 3d 50 25 2b 4c  45 4e 28 73 74 72 69 6e  | P%=P%+LEN(strin|
00002520  67 24 29 0d 20 31 35 35  30 20 3d 70 61 73 73 0d  |g$). 1550 =pass.|
00002530
28-03-88/T\SWR21.m0
28-03-88/T\SWR21.m1
28-03-88/T\SWR21.m2
28-03-88/T\SWR21.m4
28-03-88/T\SWR21.m5