Home » CEEFAX disks » telesoftware10.adl » 11-11-88/T\SWR19

11-11-88/T\SWR19

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 » telesoftware10.adl
Filename: 11-11-88/T\SWR19
Read OK:
File size: 284D 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 19 - Autoboot RFS
-------------------------------------------------------

  Most of the filing systems on the BBC microcomputer can be selected
(booted in micro-speak) by holding down CTRL with a filing system boot
key and then pressing and releasing the Break key. The DFS can be
booted with Ctrl+D+Break, the ADFS with Ctrl+F+Break, the Tape Filing
system with Ctrl+Space+Break and the Network Filing system with
Ctrl+N+Break. You might expect the RFS to boot with Ctrl+R+Break but
if you try it you will be disappointed, it does not work. The RFS is
the only filing system that can not be booted in this way. In this
module I will show you how to modify the RFS interpreter used in
Module 18 to include booting the RFS with Ctrl+R+Break.

  The BBC B issues service call 3 on both hard and soft reset. The
Master issues it only on hard reset. This service call is issued
primarily to allow filing systems to be initialised on break rather
than having to be reselected every time with an operating system
command. Any service rom can intercept this call to execute any
routine but it should only trapped if a key exclusive to that rom is
pressed. The example program BOOTRFS will intercept service call 3 and
use Osbyte &7A to read the internal key number of any key pressed and,
if the internal key number for "R" is found, it will select and
catalogue the RFS.

  Osbyte &7A has no entry parameters and returns the internal key
number in the X register. The internal key numbers are not printed in
the BBC B User Guide but the INKEY numbers are listed in the BASIC
keyword section. The INKEY number can be converted into an Internal
Key Number by Exclusive ORing it with &FF. For example, the INKEY
number for R is -52. To find the internal key number type:

>PRINT ~ -52 EOR &FF
  FFFFFF33
>

and the answer, ignoring the leading Fs, is &33.

  Figure 19.1 shows the coding that needs to be added to a SWR
interpreter to intercept service call 3 and auto-boot the RFS on
Ctrl+R+Break. The auto-boot coding can be included in any SWR
interpreter, it does not have to be in a rom with RFS files. Figure
19.1 illustrates that if, after intercepting service call 3, Osbyte
&7A returns with X=&33 then Ctrl+R+Break has been pressed and your
program can use Osbyte &8D to select the RFS. The routine returns
control to the MOS after balancing the stack and reseting the
accumulator to zero.


 .trythree
        CMP #3        \ is it autoboot?
        BNE out       \ branch if not autoboot
        PHA           \ store A
        TXA
        PHA           \ store X
        TYA
        PHA           \ store Y
        LDA #&7A      \ Osbyte &7A, no parameters
        JSR &FFF4     \ read internal key number
        CPX #&33      \ has Ctrl+R+Break been pressed?
        BEQ rbreak    \ branch if it has
        PLA           \ pull Y
        TAY           \ restore Y
        PLA           \ pull X
        TAX           \ restore X
        PLA           \ restore A
        RTS           \ return to MOS
.rbreak
        LDA #&8D      \ Osbyte &8D, no parameters
        JSR &FFF4     \ *ROM
        PLA           \ discard Y
        PLA           \ discard X
        PLA           \ discard A
        LDA #0        \ service recognised
.out
        RTS           \ return to MOS

Figure 19.1  RFS Auto-boot SWR interpreter.
-----------  ------------------------------



  The auto-boot routine in figure 19.1 has been adapted for use in the
auto-boot RFS header program BOOTRFS. This program must used with the
RFSGEN program (introduced in Module 18) to create RFS rom images. It
can only be used with RFSGEN and should replace the RFSHEAD program to
create an auto-booting RFS rom image. If RFS rom images are used in
more than one rom socket then a rom image created with BOOTRFS should
only be used in one of the rom sockets. All the other rom images
should be created with RFSHEAD to keep their rom headers as small as
possible.

  BOOTRFS intercepts service call 3, selects and catalogues the RFS
and exits with the RFS active. It uses the service call &0D and &0E
interpreter introduced in Module 18.

  Service call 3 is intercepted (line 660) and if Ctrl+R+Break is
detected (lines 720-750) control passes to the label ".rbreak" (line
820). Because it can take a couple of seconds to catalogue the RFS the
keyboard is disabled to prevent unwanted input, particularly Escape
(lines 830-860). The buffers are flushed (lines 870-890), the two zero
page bytes used by the print subroutine are stored on the stack (lines
900-930) and a header to the catalogue is printed (lines 940-990). The
RFS is selected (lines 1000-1010) and the Osbyte equivalent of *OPT1,2
is used to enable extended filing system messages (lines 1020-1050).

  The command line interpreter is instructed to catalogue the RFS
(lines 1060-1080), the default *OPT 1,0 is reselected (lines
1090-1120) and a message informing the user that the RFS is active is
printed (lines 1130-1190). The two zero page bytes used by the print
subroutine are restored (lines 1200-1230), the keyboard is re-enabled
(lines 1240-1270), and the stack balanced before returning control to
the MOS with the accumulator reset to zero (lines 1280-1320).

  BOOTRFS is used to create RFS rom images in the same way that
RFSHEAD was used in module 18. Load the rom image created by BOOTRFS
into sideways ram and press Ctrl+R+Break to select and catalogue the
RFS. If you use the program DEMO you should get a screen display
similar to that in figure 19.2.





Acorn TUBE 6502 64K

ROM Filing System Catalogue

DEMO       08 08D1    00001900 00002194

ROM Filing System active

BASIC

>

Figure 19.2  The display after Ctrl+R+Break.
-----------  -------------------------------




  With the RFS active you can run the demonstration program by typing
CHAIN "DEMO" or *RUN "DEMO". The supplied BASIC program DEMO has been
written so that it can be *RUN as well as chained. Most BASIC programs
can only be chained from the RFS, or any other filing systems.






   10 REM: BOOTRFS
   20 MODE7
   30 HIMEM=&3C00
   40 diff=&8000-HIMEM
   50 H%=HIMEM
   60 address=&70
   70 romnumber=&F4
   80 phrom=&F5
   90 rompoint=&F6
  100 osasci=&FFE3
  110 osnewl=&FFE7
  120 osbyte=&FFF4
  130 oscli=&FFF7
  140 FOR pass = 0 TO 2 STEP 2
  150 P%=HIMEM
  160 [       OPT pass
  170         BRK
  180         BRK
  190         BRK
  200         JMP service+diff
  210         OPT FNequb(&82)
  220         OPT FNequb((copyright+diff) MOD 256)
  230         BRK
  240         OPT FNequs("BOOTRFS")
  250 .copyright
  260         BRK
  270         OPT FNequs("(C) Gordon Horsington 1987")
  280         BRK
  290 .service
  300         PHA
  310         CMP #13
  320         BNE fourteen
  330         TYA
  340         EOR #&F
  350         CMP romnumber
  360         BCC out
  370         LDA #(lastbyte+diff) MOD 256
  380         STA rompoint
  390         LDA #(lastbyte+diff) DIV 256
  400         STA rompoint+1
  410         LDA romnumber
  420         EOR #&F
  430         STA phrom
  440 .exit
  450         PLA
  460         LDA #0
  470         RTS
  480 .fourteen
  490         CMP #14
  500         BNE trythree
  510         LDA phrom
  520         EOR #&F
  530         CMP romnumber
  540         BNE out
  550         LDY #0
  560         LDA (rompoint),Y
  570         TAY
  580         INC rompoint
  590         BNE exit
  600         INC rompoint+1
  610         JMP exit+diff
  620 .out
  630         PLA
  640         RTS
  650 .trythree
  660         CMP #3
  670         BNE out
  680         TXA
  690         PHA
  700         TYA
  710         PHA
  720         LDA #&7A
  730         JSR osbyte
  740         CPX #&33      \ Is it R Break?
  750         BEQ rbreak
  760         PLA
  770         TAY
  780         PLA
  790         TAX
  800         PLA
  810         RTS
  820 .rbreak
  830         LDA #&C9
  840         LDX #1
  850         LDY #0
  860         JSR osbyte    \ Disable keyboard
  870         LDA #&0F
  880         LDX #0
  890         JSR osbyte    \ Flush all buffers
  900         LDA address
  910         PHA
  920         LDA address+1
  930         PHA
  940         LDX #(rfs+diff) MOD 256
  950         LDY #(rfs+diff) DIV 256
  960         JSR print+diff
  970         LDX #(cat+diff) MOD 256
  980         LDY #(cat+diff) DIV 256
  990         JSR print+diff
 1000         LDA #&8D
 1010         JSR osbyte    \ Select RFS
 1020         LDA #&8B
 1030         LDX #1
 1040         LDY #2
 1050         JSR osbyte    \ *OPT1,2
 1060         LDX #(dot+diff) MOD 256
 1070         LDY #(dot+diff) DIV 256
 1080         JSR oscli     \ Catalogue RFS
 1090         LDA #&8B
 1100         LDX #0
 1110         LDY #0
 1120         JSR osbyte    \ *OPT 1,0
 1130         JSR osnewl
 1140         LDX #(rfs+diff) MOD 256
 1150         LDY #(rfs+diff) DIV 256
 1160         JSR print+diff
 1170         LDX #(act+diff) MOD 256
 1180         LDY #(act+diff) DIV 256
 1190         JSR print+diff
 1200         PLA
 1210         STA address+1
 1220         PLA
 1230         STA address
 1240         LDA #&C9
 1250         LDX #0
 1260         LDY #0
 1270         JSR osbyte    \ Enable keyboard
 1280         PLA
 1290         PLA
 1300         PLA
 1310         LDA #0
 1320         RTS
 1330 .print
 1340         STX address
 1350         STY address+1
 1360         LDY #&FF
 1370 .printloop
 1380         INY
 1390         LDA (address),Y
 1400         BEQ endprint
 1410         JSR osasci
 1420         JMP printloop+diff
 1430 .endprint
 1440         RTS
 1450 .dot
 1460         OPT FNequs("CAT")
 1470         OPT FNequb(&0D)
 1480 .rfs
 1490         OPT FNequs("ROM Filing System ")
 1500         BRK
 1510 .cat
 1520         OPT FNequs("Catalogue")
 1530         OPT FNequb(&0D)
 1540         BRK
 1550 .act
 1560         OPT FNequs("active")
 1570         OPT FNequw(&0D0D)
 1580         BRK
 1590 .lastbyte
 1600 ]
 1610 NEXT
 1620 O%=lastbyte
 1630 CHAIN"RFSGEN"
 1640 DEFFNequb(byte)
 1650 ?P%=byte
 1660 P%=P%+1
 1670 =pass
 1680 DEFFNequw(word)
 1690 ?P%=word MOD 256
 1700 P%?1=word DIV 256
 1710 P%=P%+2
 1720 =pass
 1730 DEFFNequd(double)
 1740 !P%=double
 1750 P%=P%+4
 1760 =pass
 1770 DEFFNequs(string$)
 1780 $P%=string$
 1790 P%=P%+LEN(string$)
 1800 =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 39  20 2d 20 41 75 74 6f 62  |odule 19 - Autob|
00000030  6f 6f 74 20 52 46 53 0d  2d 2d 2d 2d 2d 2d 2d 2d  |oot RFS.--------|
00000040  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
*
00000060  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 0d  |---------------.|
00000070  0d 20 20 4d 6f 73 74 20  6f 66 20 74 68 65 20 66  |.  Most of the f|
00000080  69 6c 69 6e 67 20 73 79  73 74 65 6d 73 20 6f 6e  |iling systems on|
00000090  20 74 68 65 20 42 42 43  20 6d 69 63 72 6f 63 6f  | the BBC microco|
000000a0  6d 70 75 74 65 72 20 63  61 6e 20 62 65 20 73 65  |mputer can be se|
000000b0  6c 65 63 74 65 64 0d 28  62 6f 6f 74 65 64 20 69  |lected.(booted i|
000000c0  6e 20 6d 69 63 72 6f 2d  73 70 65 61 6b 29 20 62  |n micro-speak) b|
000000d0  79 20 68 6f 6c 64 69 6e  67 20 64 6f 77 6e 20 43  |y holding down C|
000000e0  54 52 4c 20 77 69 74 68  20 61 20 66 69 6c 69 6e  |TRL with a filin|
000000f0  67 20 73 79 73 74 65 6d  20 62 6f 6f 74 0d 6b 65  |g system boot.ke|
00000100  79 20 61 6e 64 20 74 68  65 6e 20 70 72 65 73 73  |y and then press|
00000110  69 6e 67 20 61 6e 64 20  72 65 6c 65 61 73 69 6e  |ing and releasin|
00000120  67 20 74 68 65 20 42 72  65 61 6b 20 6b 65 79 2e  |g the Break key.|
00000130  20 54 68 65 20 44 46 53  20 63 61 6e 20 62 65 0d  | The DFS can be.|
00000140  62 6f 6f 74 65 64 20 77  69 74 68 20 43 74 72 6c  |booted with Ctrl|
00000150  2b 44 2b 42 72 65 61 6b  2c 20 74 68 65 20 41 44  |+D+Break, the AD|
00000160  46 53 20 77 69 74 68 20  43 74 72 6c 2b 46 2b 42  |FS with Ctrl+F+B|
00000170  72 65 61 6b 2c 20 74 68  65 20 54 61 70 65 20 46  |reak, the Tape F|
00000180  69 6c 69 6e 67 0d 73 79  73 74 65 6d 20 77 69 74  |iling.system wit|
00000190  68 20 43 74 72 6c 2b 53  70 61 63 65 2b 42 72 65  |h Ctrl+Space+Bre|
000001a0  61 6b 20 61 6e 64 20 74  68 65 20 4e 65 74 77 6f  |ak and the Netwo|
000001b0  72 6b 20 46 69 6c 69 6e  67 20 73 79 73 74 65 6d  |rk Filing system|
000001c0  20 77 69 74 68 0d 43 74  72 6c 2b 4e 2b 42 72 65  | with.Ctrl+N+Bre|
000001d0  61 6b 2e 20 59 6f 75 20  6d 69 67 68 74 20 65 78  |ak. You might ex|
000001e0  70 65 63 74 20 74 68 65  20 52 46 53 20 74 6f 20  |pect the RFS to |
000001f0  62 6f 6f 74 20 77 69 74  68 20 43 74 72 6c 2b 52  |boot with Ctrl+R|
00000200  2b 42 72 65 61 6b 20 62  75 74 0d 69 66 20 79 6f  |+Break but.if yo|
00000210  75 20 74 72 79 20 69 74  20 79 6f 75 20 77 69 6c  |u try it you wil|
00000220  6c 20 62 65 20 64 69 73  61 70 70 6f 69 6e 74 65  |l be disappointe|
00000230  64 2c 20 69 74 20 64 6f  65 73 20 6e 6f 74 20 77  |d, it does not w|
00000240  6f 72 6b 2e 20 54 68 65  20 52 46 53 20 69 73 0d  |ork. The RFS is.|
00000250  74 68 65 20 6f 6e 6c 79  20 66 69 6c 69 6e 67 20  |the only filing |
00000260  73 79 73 74 65 6d 20 74  68 61 74 20 63 61 6e 20  |system that can |
00000270  6e 6f 74 20 62 65 20 62  6f 6f 74 65 64 20 69 6e  |not be booted in|
00000280  20 74 68 69 73 20 77 61  79 2e 20 49 6e 20 74 68  | this way. In th|
00000290  69 73 0d 6d 6f 64 75 6c  65 20 49 20 77 69 6c 6c  |is.module I will|
000002a0  20 73 68 6f 77 20 79 6f  75 20 68 6f 77 20 74 6f  | show you how to|
000002b0  20 6d 6f 64 69 66 79 20  74 68 65 20 52 46 53 20  | modify the RFS |
000002c0  69 6e 74 65 72 70 72 65  74 65 72 20 75 73 65 64  |interpreter used|
000002d0  20 69 6e 0d 4d 6f 64 75  6c 65 20 31 38 20 74 6f  | in.Module 18 to|
000002e0  20 69 6e 63 6c 75 64 65  20 62 6f 6f 74 69 6e 67  | include booting|
000002f0  20 74 68 65 20 52 46 53  20 77 69 74 68 20 43 74  | the RFS with Ct|
00000300  72 6c 2b 52 2b 42 72 65  61 6b 2e 0d 0d 20 20 54  |rl+R+Break...  T|
00000310  68 65 20 42 42 43 20 42  20 69 73 73 75 65 73 20  |he BBC B issues |
00000320  73 65 72 76 69 63 65 20  63 61 6c 6c 20 33 20 6f  |service call 3 o|
00000330  6e 20 62 6f 74 68 20 68  61 72 64 20 61 6e 64 20  |n both hard and |
00000340  73 6f 66 74 20 72 65 73  65 74 2e 20 54 68 65 0d  |soft reset. The.|
00000350  4d 61 73 74 65 72 20 69  73 73 75 65 73 20 69 74  |Master issues it|
00000360  20 6f 6e 6c 79 20 6f 6e  20 68 61 72 64 20 72 65  | only on hard re|
00000370  73 65 74 2e 20 54 68 69  73 20 73 65 72 76 69 63  |set. This servic|
00000380  65 20 63 61 6c 6c 20 69  73 20 69 73 73 75 65 64  |e call is issued|
00000390  0d 70 72 69 6d 61 72 69  6c 79 20 74 6f 20 61 6c  |.primarily to al|
000003a0  6c 6f 77 20 66 69 6c 69  6e 67 20 73 79 73 74 65  |low filing syste|
000003b0  6d 73 20 74 6f 20 62 65  20 69 6e 69 74 69 61 6c  |ms to be initial|
000003c0  69 73 65 64 20 6f 6e 20  62 72 65 61 6b 20 72 61  |ised on break ra|
000003d0  74 68 65 72 0d 74 68 61  6e 20 68 61 76 69 6e 67  |ther.than having|
000003e0  20 74 6f 20 62 65 20 72  65 73 65 6c 65 63 74 65  | to be reselecte|
000003f0  64 20 65 76 65 72 79 20  74 69 6d 65 20 77 69 74  |d every time wit|
00000400  68 20 61 6e 20 6f 70 65  72 61 74 69 6e 67 20 73  |h an operating s|
00000410  79 73 74 65 6d 0d 63 6f  6d 6d 61 6e 64 2e 20 41  |ystem.command. A|
00000420  6e 79 20 73 65 72 76 69  63 65 20 72 6f 6d 20 63  |ny service rom c|
00000430  61 6e 20 69 6e 74 65 72  63 65 70 74 20 74 68 69  |an intercept thi|
00000440  73 20 63 61 6c 6c 20 74  6f 20 65 78 65 63 75 74  |s call to execut|
00000450  65 20 61 6e 79 0d 72 6f  75 74 69 6e 65 20 62 75  |e any.routine bu|
00000460  74 20 69 74 20 73 68 6f  75 6c 64 20 6f 6e 6c 79  |t it should only|
00000470  20 74 72 61 70 70 65 64  20 69 66 20 61 20 6b 65  | trapped if a ke|
00000480  79 20 65 78 63 6c 75 73  69 76 65 20 74 6f 20 74  |y exclusive to t|
00000490  68 61 74 20 72 6f 6d 20  69 73 0d 70 72 65 73 73  |hat rom is.press|
000004a0  65 64 2e 20 54 68 65 20  65 78 61 6d 70 6c 65 20  |ed. The example |
000004b0  70 72 6f 67 72 61 6d 20  42 4f 4f 54 52 46 53 20  |program BOOTRFS |
000004c0  77 69 6c 6c 20 69 6e 74  65 72 63 65 70 74 20 73  |will intercept s|
000004d0  65 72 76 69 63 65 20 63  61 6c 6c 20 33 20 61 6e  |ervice call 3 an|
000004e0  64 0d 75 73 65 20 4f 73  62 79 74 65 20 26 37 41  |d.use Osbyte &7A|
000004f0  20 74 6f 20 72 65 61 64  20 74 68 65 20 69 6e 74  | to read the int|
00000500  65 72 6e 61 6c 20 6b 65  79 20 6e 75 6d 62 65 72  |ernal key number|
00000510  20 6f 66 20 61 6e 79 20  6b 65 79 20 70 72 65 73  | of any key pres|
00000520  73 65 64 20 61 6e 64 2c  0d 69 66 20 74 68 65 20  |sed and,.if the |
00000530  69 6e 74 65 72 6e 61 6c  20 6b 65 79 20 6e 75 6d  |internal key num|
00000540  62 65 72 20 66 6f 72 20  22 52 22 20 69 73 20 66  |ber for "R" is f|
00000550  6f 75 6e 64 2c 20 69 74  20 77 69 6c 6c 20 73 65  |ound, it will se|
00000560  6c 65 63 74 20 61 6e 64  0d 63 61 74 61 6c 6f 67  |lect and.catalog|
00000570  75 65 20 74 68 65 20 52  46 53 2e 0d 0d 20 20 4f  |ue the RFS...  O|
00000580  73 62 79 74 65 20 26 37  41 20 68 61 73 20 6e 6f  |sbyte &7A has no|
00000590  20 65 6e 74 72 79 20 70  61 72 61 6d 65 74 65 72  | entry parameter|
000005a0  73 20 61 6e 64 20 72 65  74 75 72 6e 73 20 74 68  |s and returns th|
000005b0  65 20 69 6e 74 65 72 6e  61 6c 20 6b 65 79 0d 6e  |e internal key.n|
000005c0  75 6d 62 65 72 20 69 6e  20 74 68 65 20 58 20 72  |umber in the X r|
000005d0  65 67 69 73 74 65 72 2e  20 54 68 65 20 69 6e 74  |egister. The int|
000005e0  65 72 6e 61 6c 20 6b 65  79 20 6e 75 6d 62 65 72  |ernal key number|
000005f0  73 20 61 72 65 20 6e 6f  74 20 70 72 69 6e 74 65  |s are not printe|
00000600  64 20 69 6e 0d 74 68 65  20 42 42 43 20 42 20 55  |d in.the BBC B U|
00000610  73 65 72 20 47 75 69 64  65 20 62 75 74 20 74 68  |ser Guide but th|
00000620  65 20 49 4e 4b 45 59 20  6e 75 6d 62 65 72 73 20  |e INKEY numbers |
00000630  61 72 65 20 6c 69 73 74  65 64 20 69 6e 20 74 68  |are listed in th|
00000640  65 20 42 41 53 49 43 0d  6b 65 79 77 6f 72 64 20  |e BASIC.keyword |
00000650  73 65 63 74 69 6f 6e 2e  20 54 68 65 20 49 4e 4b  |section. The INK|
00000660  45 59 20 6e 75 6d 62 65  72 20 63 61 6e 20 62 65  |EY number can be|
00000670  20 63 6f 6e 76 65 72 74  65 64 20 69 6e 74 6f 20  | converted into |
00000680  61 6e 20 49 6e 74 65 72  6e 61 6c 0d 4b 65 79 20  |an Internal.Key |
00000690  4e 75 6d 62 65 72 20 62  79 20 45 78 63 6c 75 73  |Number by Exclus|
000006a0  69 76 65 20 4f 52 69 6e  67 20 69 74 20 77 69 74  |ive ORing it wit|
000006b0  68 20 26 46 46 2e 20 46  6f 72 20 65 78 61 6d 70  |h &FF. For examp|
000006c0  6c 65 2c 20 74 68 65 20  49 4e 4b 45 59 0d 6e 75  |le, the INKEY.nu|
000006d0  6d 62 65 72 20 66 6f 72  20 52 20 69 73 20 2d 35  |mber for R is -5|
000006e0  32 2e 20 54 6f 20 66 69  6e 64 20 74 68 65 20 69  |2. To find the i|
000006f0  6e 74 65 72 6e 61 6c 20  6b 65 79 20 6e 75 6d 62  |nternal key numb|
00000700  65 72 20 74 79 70 65 3a  0d 0d 3e 50 52 49 4e 54  |er type:..>PRINT|
00000710  20 7e 20 2d 35 32 20 45  4f 52 20 26 46 46 0d 20  | ~ -52 EOR &FF. |
00000720  20 46 46 46 46 46 46 33  33 0d 3e 0d 0d 61 6e 64  | FFFFFF33.>..and|
00000730  20 74 68 65 20 61 6e 73  77 65 72 2c 20 69 67 6e  | the answer, ign|
00000740  6f 72 69 6e 67 20 74 68  65 20 6c 65 61 64 69 6e  |oring the leadin|
00000750  67 20 46 73 2c 20 69 73  20 26 33 33 2e 0d 0d 20  |g Fs, is &33... |
00000760  20 46 69 67 75 72 65 20  31 39 2e 31 20 73 68 6f  | Figure 19.1 sho|
00000770  77 73 20 74 68 65 20 63  6f 64 69 6e 67 20 74 68  |ws the coding th|
00000780  61 74 20 6e 65 65 64 73  20 74 6f 20 62 65 20 61  |at needs to be a|
00000790  64 64 65 64 20 74 6f 20  61 20 53 57 52 0d 69 6e  |dded to a SWR.in|
000007a0  74 65 72 70 72 65 74 65  72 20 74 6f 20 69 6e 74  |terpreter to int|
000007b0  65 72 63 65 70 74 20 73  65 72 76 69 63 65 20 63  |ercept service c|
000007c0  61 6c 6c 20 33 20 61 6e  64 20 61 75 74 6f 2d 62  |all 3 and auto-b|
000007d0  6f 6f 74 20 74 68 65 20  52 46 53 20 6f 6e 0d 43  |oot the RFS on.C|
000007e0  74 72 6c 2b 52 2b 42 72  65 61 6b 2e 20 54 68 65  |trl+R+Break. The|
000007f0  20 61 75 74 6f 2d 62 6f  6f 74 20 63 6f 64 69 6e  | auto-boot codin|
00000800  67 20 63 61 6e 20 62 65  20 69 6e 63 6c 75 64 65  |g can be include|
00000810  64 20 69 6e 20 61 6e 79  20 53 57 52 0d 69 6e 74  |d in any SWR.int|
00000820  65 72 70 72 65 74 65 72  2c 20 69 74 20 64 6f 65  |erpreter, it doe|
00000830  73 20 6e 6f 74 20 68 61  76 65 20 74 6f 20 62 65  |s not have to be|
00000840  20 69 6e 20 61 20 72 6f  6d 20 77 69 74 68 20 52  | in a rom with R|
00000850  46 53 20 66 69 6c 65 73  2e 20 46 69 67 75 72 65  |FS files. Figure|
00000860  0d 31 39 2e 31 20 69 6c  6c 75 73 74 72 61 74 65  |.19.1 illustrate|
00000870  73 20 74 68 61 74 20 69  66 2c 20 61 66 74 65 72  |s that if, after|
00000880  20 69 6e 74 65 72 63 65  70 74 69 6e 67 20 73 65  | intercepting se|
00000890  72 76 69 63 65 20 63 61  6c 6c 20 33 2c 20 4f 73  |rvice call 3, Os|
000008a0  62 79 74 65 0d 26 37 41  20 72 65 74 75 72 6e 73  |byte.&7A returns|
000008b0  20 77 69 74 68 20 58 3d  26 33 33 20 74 68 65 6e  | with X=&33 then|
000008c0  20 43 74 72 6c 2b 52 2b  42 72 65 61 6b 20 68 61  | Ctrl+R+Break ha|
000008d0  73 20 62 65 65 6e 20 70  72 65 73 73 65 64 20 61  |s been pressed a|
000008e0  6e 64 20 79 6f 75 72 0d  70 72 6f 67 72 61 6d 20  |nd your.program |
000008f0  63 61 6e 20 75 73 65 20  4f 73 62 79 74 65 20 26  |can use Osbyte &|
00000900  38 44 20 74 6f 20 73 65  6c 65 63 74 20 74 68 65  |8D to select the|
00000910  20 52 46 53 2e 20 54 68  65 20 72 6f 75 74 69 6e  | RFS. The routin|
00000920  65 20 72 65 74 75 72 6e  73 0d 63 6f 6e 74 72 6f  |e returns.contro|
00000930  6c 20 74 6f 20 74 68 65  20 4d 4f 53 20 61 66 74  |l to the MOS aft|
00000940  65 72 20 62 61 6c 61 6e  63 69 6e 67 20 74 68 65  |er balancing the|
00000950  20 73 74 61 63 6b 20 61  6e 64 20 72 65 73 65 74  | stack and reset|
00000960  69 6e 67 20 74 68 65 0d  61 63 63 75 6d 75 6c 61  |ing the.accumula|
00000970  74 6f 72 20 74 6f 20 7a  65 72 6f 2e 0d 0d 0d 20  |tor to zero.... |
00000980  2e 74 72 79 74 68 72 65  65 0d 20 20 20 20 20 20  |.trythree.      |
00000990  20 20 43 4d 50 20 23 33  20 20 20 20 20 20 20 20  |  CMP #3        |
000009a0  5c 20 69 73 20 69 74 20  61 75 74 6f 62 6f 6f 74  |\ is it autoboot|
000009b0  3f 0d 20 20 20 20 20 20  20 20 42 4e 45 20 6f 75  |?.        BNE ou|
000009c0  74 20 20 20 20 20 20 20  5c 20 62 72 61 6e 63 68  |t       \ branch|
000009d0  20 69 66 20 6e 6f 74 20  61 75 74 6f 62 6f 6f 74  | if not autoboot|
000009e0  0d 20 20 20 20 20 20 20  20 50 48 41 20 20 20 20  |.        PHA    |
000009f0  20 20 20 20 20 20 20 5c  20 73 74 6f 72 65 20 41  |       \ store A|
00000a00  0d 20 20 20 20 20 20 20  20 54 58 41 0d 20 20 20  |.        TXA.   |
00000a10  20 20 20 20 20 50 48 41  20 20 20 20 20 20 20 20  |     PHA        |
00000a20  20 20 20 5c 20 73 74 6f  72 65 20 58 0d 20 20 20  |   \ store X.   |
00000a30  20 20 20 20 20 54 59 41  0d 20 20 20 20 20 20 20  |     TYA.       |
00000a40  20 50 48 41 20 20 20 20  20 20 20 20 20 20 20 5c  | PHA           \|
00000a50  20 73 74 6f 72 65 20 59  0d 20 20 20 20 20 20 20  | store Y.       |
00000a60  20 4c 44 41 20 23 26 37  41 20 20 20 20 20 20 5c  | LDA #&7A      \|
00000a70  20 4f 73 62 79 74 65 20  26 37 41 2c 20 6e 6f 20  | Osbyte &7A, no |
00000a80  70 61 72 61 6d 65 74 65  72 73 0d 20 20 20 20 20  |parameters.     |
00000a90  20 20 20 4a 53 52 20 26  46 46 46 34 20 20 20 20  |   JSR &FFF4    |
00000aa0  20 5c 20 72 65 61 64 20  69 6e 74 65 72 6e 61 6c  | \ read internal|
00000ab0  20 6b 65 79 20 6e 75 6d  62 65 72 0d 20 20 20 20  | key number.    |
00000ac0  20 20 20 20 43 50 58 20  23 26 33 33 20 20 20 20  |    CPX #&33    |
00000ad0  20 20 5c 20 68 61 73 20  43 74 72 6c 2b 52 2b 42  |  \ has Ctrl+R+B|
00000ae0  72 65 61 6b 20 62 65 65  6e 20 70 72 65 73 73 65  |reak been presse|
00000af0  64 3f 0d 20 20 20 20 20  20 20 20 42 45 51 20 72  |d?.        BEQ r|
00000b00  62 72 65 61 6b 20 20 20  20 5c 20 62 72 61 6e 63  |break    \ branc|
00000b10  68 20 69 66 20 69 74 20  68 61 73 0d 20 20 20 20  |h if it has.    |
00000b20  20 20 20 20 50 4c 41 20  20 20 20 20 20 20 20 20  |    PLA         |
00000b30  20 20 5c 20 70 75 6c 6c  20 59 0d 20 20 20 20 20  |  \ pull Y.     |
00000b40  20 20 20 54 41 59 20 20  20 20 20 20 20 20 20 20  |   TAY          |
00000b50  20 5c 20 72 65 73 74 6f  72 65 20 59 0d 20 20 20  | \ restore Y.   |
00000b60  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00000b70  20 20 20 5c 20 70 75 6c  6c 20 58 0d 20 20 20 20  |   \ pull X.    |
00000b80  20 20 20 20 54 41 58 20  20 20 20 20 20 20 20 20  |    TAX         |
00000b90  20 20 5c 20 72 65 73 74  6f 72 65 20 58 0d 20 20  |  \ restore X.  |
00000ba0  20 20 20 20 20 20 50 4c  41 20 20 20 20 20 20 20  |      PLA       |
00000bb0  20 20 20 20 5c 20 72 65  73 74 6f 72 65 20 41 0d  |    \ restore A.|
00000bc0  20 20 20 20 20 20 20 20  52 54 53 20 20 20 20 20  |        RTS     |
00000bd0  20 20 20 20 20 20 5c 20  72 65 74 75 72 6e 20 74  |      \ return t|
00000be0  6f 20 4d 4f 53 0d 2e 72  62 72 65 61 6b 0d 20 20  |o MOS..rbreak.  |
00000bf0  20 20 20 20 20 20 4c 44  41 20 23 26 38 44 20 20  |      LDA #&8D  |
00000c00  20 20 20 20 5c 20 4f 73  62 79 74 65 20 26 38 44  |    \ Osbyte &8D|
00000c10  2c 20 6e 6f 20 70 61 72  61 6d 65 74 65 72 73 0d  |, no parameters.|
00000c20  20 20 20 20 20 20 20 20  4a 53 52 20 26 46 46 46  |        JSR &FFF|
00000c30  34 20 20 20 20 20 5c 20  2a 52 4f 4d 0d 20 20 20  |4     \ *ROM.   |
00000c40  20 20 20 20 20 50 4c 41  20 20 20 20 20 20 20 20  |     PLA        |
00000c50  20 20 20 5c 20 64 69 73  63 61 72 64 20 59 0d 20  |   \ discard Y. |
00000c60  20 20 20 20 20 20 20 50  4c 41 20 20 20 20 20 20  |       PLA      |
00000c70  20 20 20 20 20 5c 20 64  69 73 63 61 72 64 20 58  |     \ discard X|
00000c80  0d 20 20 20 20 20 20 20  20 50 4c 41 20 20 20 20  |.        PLA    |
00000c90  20 20 20 20 20 20 20 5c  20 64 69 73 63 61 72 64  |       \ discard|
00000ca0  20 41 0d 20 20 20 20 20  20 20 20 4c 44 41 20 23  | A.        LDA #|
00000cb0  30 20 20 20 20 20 20 20  20 5c 20 73 65 72 76 69  |0        \ servi|
00000cc0  63 65 20 72 65 63 6f 67  6e 69 73 65 64 0d 2e 6f  |ce recognised..o|
00000cd0  75 74 0d 20 20 20 20 20  20 20 20 52 54 53 20 20  |ut.        RTS  |
00000ce0  20 20 20 20 20 20 20 20  20 5c 20 72 65 74 75 72  |         \ retur|
00000cf0  6e 20 74 6f 20 4d 4f 53  0d 0d 46 69 67 75 72 65  |n to MOS..Figure|
00000d00  20 31 39 2e 31 20 20 52  46 53 20 41 75 74 6f 2d  | 19.1  RFS Auto-|
00000d10  62 6f 6f 74 20 53 57 52  20 69 6e 74 65 72 70 72  |boot SWR interpr|
00000d20  65 74 65 72 2e 0d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |eter..----------|
00000d30  2d 20 20 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |-  -------------|
00000d40  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00000d50  2d 0d 0d 0d 0d 20 20 54  68 65 20 61 75 74 6f 2d  |-....  The auto-|
00000d60  62 6f 6f 74 20 72 6f 75  74 69 6e 65 20 69 6e 20  |boot routine in |
00000d70  66 69 67 75 72 65 20 31  39 2e 31 20 68 61 73 20  |figure 19.1 has |
00000d80  62 65 65 6e 20 61 64 61  70 74 65 64 20 66 6f 72  |been adapted for|
00000d90  20 75 73 65 20 69 6e 20  74 68 65 0d 61 75 74 6f  | use in the.auto|
00000da0  2d 62 6f 6f 74 20 52 46  53 20 68 65 61 64 65 72  |-boot RFS header|
00000db0  20 70 72 6f 67 72 61 6d  20 42 4f 4f 54 52 46 53  | program BOOTRFS|
00000dc0  2e 20 54 68 69 73 20 70  72 6f 67 72 61 6d 20 6d  |. This program m|
00000dd0  75 73 74 20 75 73 65 64  20 77 69 74 68 20 74 68  |ust used with th|
00000de0  65 0d 52 46 53 47 45 4e  20 70 72 6f 67 72 61 6d  |e.RFSGEN program|
00000df0  20 28 69 6e 74 72 6f 64  75 63 65 64 20 69 6e 20  | (introduced in |
00000e00  4d 6f 64 75 6c 65 20 31  38 29 20 74 6f 20 63 72  |Module 18) to cr|
00000e10  65 61 74 65 20 52 46 53  20 72 6f 6d 20 69 6d 61  |eate RFS rom ima|
00000e20  67 65 73 2e 20 49 74 0d  63 61 6e 20 6f 6e 6c 79  |ges. It.can only|
00000e30  20 62 65 20 75 73 65 64  20 77 69 74 68 20 52 46  | be used with RF|
00000e40  53 47 45 4e 20 61 6e 64  20 73 68 6f 75 6c 64 20  |SGEN and should |
00000e50  72 65 70 6c 61 63 65 20  74 68 65 20 52 46 53 48  |replace the RFSH|
00000e60  45 41 44 20 70 72 6f 67  72 61 6d 20 74 6f 0d 63  |EAD program to.c|
00000e70  72 65 61 74 65 20 61 6e  20 61 75 74 6f 2d 62 6f  |reate an auto-bo|
00000e80  6f 74 69 6e 67 20 52 46  53 20 72 6f 6d 20 69 6d  |oting RFS rom im|
00000e90  61 67 65 2e 20 49 66 20  52 46 53 20 72 6f 6d 20  |age. If RFS rom |
00000ea0  69 6d 61 67 65 73 20 61  72 65 20 75 73 65 64 20  |images are used |
00000eb0  69 6e 0d 6d 6f 72 65 20  74 68 61 6e 20 6f 6e 65  |in.more than one|
00000ec0  20 72 6f 6d 20 73 6f 63  6b 65 74 20 74 68 65 6e  | rom socket then|
00000ed0  20 61 20 72 6f 6d 20 69  6d 61 67 65 20 63 72 65  | a rom image cre|
00000ee0  61 74 65 64 20 77 69 74  68 20 42 4f 4f 54 52 46  |ated with BOOTRF|
00000ef0  53 20 73 68 6f 75 6c 64  0d 6f 6e 6c 79 20 62 65  |S should.only be|
00000f00  20 75 73 65 64 20 69 6e  20 6f 6e 65 20 6f 66 20  | used in one of |
00000f10  74 68 65 20 72 6f 6d 20  73 6f 63 6b 65 74 73 2e  |the rom sockets.|
00000f20  20 41 6c 6c 20 74 68 65  20 6f 74 68 65 72 20 72  | All the other r|
00000f30  6f 6d 20 69 6d 61 67 65  73 0d 73 68 6f 75 6c 64  |om images.should|
00000f40  20 62 65 20 63 72 65 61  74 65 64 20 77 69 74 68  | be created with|
00000f50  20 52 46 53 48 45 41 44  20 74 6f 20 6b 65 65 70  | RFSHEAD to keep|
00000f60  20 74 68 65 69 72 20 72  6f 6d 20 68 65 61 64 65  | their rom heade|
00000f70  72 73 20 61 73 20 73 6d  61 6c 6c 20 61 73 0d 70  |rs as small as.p|
00000f80  6f 73 73 69 62 6c 65 2e  0d 0d 20 20 42 4f 4f 54  |ossible...  BOOT|
00000f90  52 46 53 20 69 6e 74 65  72 63 65 70 74 73 20 73  |RFS intercepts s|
00000fa0  65 72 76 69 63 65 20 63  61 6c 6c 20 33 2c 20 73  |ervice call 3, s|
00000fb0  65 6c 65 63 74 73 20 61  6e 64 20 63 61 74 61 6c  |elects and catal|
00000fc0  6f 67 75 65 73 20 74 68  65 20 52 46 53 0d 61 6e  |ogues the RFS.an|
00000fd0  64 20 65 78 69 74 73 20  77 69 74 68 20 74 68 65  |d exits with the|
00000fe0  20 52 46 53 20 61 63 74  69 76 65 2e 20 49 74 20  | RFS active. It |
00000ff0  75 73 65 73 20 74 68 65  20 73 65 72 76 69 63 65  |uses the service|
00001000  20 63 61 6c 6c 20 26 30  44 20 61 6e 64 20 26 30  | call &0D and &0|
00001010  45 0d 69 6e 74 65 72 70  72 65 74 65 72 20 69 6e  |E.interpreter in|
00001020  74 72 6f 64 75 63 65 64  20 69 6e 20 4d 6f 64 75  |troduced in Modu|
00001030  6c 65 20 31 38 2e 0d 0d  20 20 53 65 72 76 69 63  |le 18...  Servic|
00001040  65 20 63 61 6c 6c 20 33  20 69 73 20 69 6e 74 65  |e call 3 is inte|
00001050  72 63 65 70 74 65 64 20  28 6c 69 6e 65 20 36 36  |rcepted (line 66|
00001060  30 29 20 61 6e 64 20 69  66 20 43 74 72 6c 2b 52  |0) and if Ctrl+R|
00001070  2b 42 72 65 61 6b 20 69  73 0d 64 65 74 65 63 74  |+Break is.detect|
00001080  65 64 20 28 6c 69 6e 65  73 20 37 32 30 2d 37 35  |ed (lines 720-75|
00001090  30 29 20 63 6f 6e 74 72  6f 6c 20 70 61 73 73 65  |0) control passe|
000010a0  73 20 74 6f 20 74 68 65  20 6c 61 62 65 6c 20 22  |s to the label "|
000010b0  2e 72 62 72 65 61 6b 22  20 28 6c 69 6e 65 0d 38  |.rbreak" (line.8|
000010c0  32 30 29 2e 20 42 65 63  61 75 73 65 20 69 74 20  |20). Because it |
000010d0  63 61 6e 20 74 61 6b 65  20 61 20 63 6f 75 70 6c  |can take a coupl|
000010e0  65 20 6f 66 20 73 65 63  6f 6e 64 73 20 74 6f 20  |e of seconds to |
000010f0  63 61 74 61 6c 6f 67 75  65 20 74 68 65 20 52 46  |catalogue the RF|
00001100  53 20 74 68 65 0d 6b 65  79 62 6f 61 72 64 20 69  |S the.keyboard i|
00001110  73 20 64 69 73 61 62 6c  65 64 20 74 6f 20 70 72  |s disabled to pr|
00001120  65 76 65 6e 74 20 75 6e  77 61 6e 74 65 64 20 69  |event unwanted i|
00001130  6e 70 75 74 2c 20 70 61  72 74 69 63 75 6c 61 72  |nput, particular|
00001140  6c 79 20 45 73 63 61 70  65 0d 28 6c 69 6e 65 73  |ly Escape.(lines|
00001150  20 38 33 30 2d 38 36 30  29 2e 20 54 68 65 20 62  | 830-860). The b|
00001160  75 66 66 65 72 73 20 61  72 65 20 66 6c 75 73 68  |uffers are flush|
00001170  65 64 20 28 6c 69 6e 65  73 20 38 37 30 2d 38 39  |ed (lines 870-89|
00001180  30 29 2c 20 74 68 65 20  74 77 6f 20 7a 65 72 6f  |0), the two zero|
00001190  0d 70 61 67 65 20 62 79  74 65 73 20 75 73 65 64  |.page bytes used|
000011a0  20 62 79 20 74 68 65 20  70 72 69 6e 74 20 73 75  | by the print su|
000011b0  62 72 6f 75 74 69 6e 65  20 61 72 65 20 73 74 6f  |broutine are sto|
000011c0  72 65 64 20 6f 6e 20 74  68 65 20 73 74 61 63 6b  |red on the stack|
000011d0  20 28 6c 69 6e 65 73 0d  39 30 30 2d 39 33 30 29  | (lines.900-930)|
000011e0  20 61 6e 64 20 61 20 68  65 61 64 65 72 20 74 6f  | and a header to|
000011f0  20 74 68 65 20 63 61 74  61 6c 6f 67 75 65 20 69  | the catalogue i|
00001200  73 20 70 72 69 6e 74 65  64 20 28 6c 69 6e 65 73  |s printed (lines|
00001210  20 39 34 30 2d 39 39 30  29 2e 20 54 68 65 0d 52  | 940-990). The.R|
00001220  46 53 20 69 73 20 73 65  6c 65 63 74 65 64 20 28  |FS is selected (|
00001230  6c 69 6e 65 73 20 31 30  30 30 2d 31 30 31 30 29  |lines 1000-1010)|
00001240  20 61 6e 64 20 74 68 65  20 4f 73 62 79 74 65 20  | and the Osbyte |
00001250  65 71 75 69 76 61 6c 65  6e 74 20 6f 66 20 2a 4f  |equivalent of *O|
00001260  50 54 31 2c 32 0d 69 73  20 75 73 65 64 20 74 6f  |PT1,2.is used to|
00001270  20 65 6e 61 62 6c 65 20  65 78 74 65 6e 64 65 64  | enable extended|
00001280  20 66 69 6c 69 6e 67 20  73 79 73 74 65 6d 20 6d  | filing system m|
00001290  65 73 73 61 67 65 73 20  28 6c 69 6e 65 73 20 31  |essages (lines 1|
000012a0  30 32 30 2d 31 30 35 30  29 2e 0d 0d 20 20 54 68  |020-1050)...  Th|
000012b0  65 20 63 6f 6d 6d 61 6e  64 20 6c 69 6e 65 20 69  |e command line i|
000012c0  6e 74 65 72 70 72 65 74  65 72 20 69 73 20 69 6e  |nterpreter is in|
000012d0  73 74 72 75 63 74 65 64  20 74 6f 20 63 61 74 61  |structed to cata|
000012e0  6c 6f 67 75 65 20 74 68  65 20 52 46 53 0d 28 6c  |logue the RFS.(l|
000012f0  69 6e 65 73 20 31 30 36  30 2d 31 30 38 30 29 2c  |ines 1060-1080),|
00001300  20 74 68 65 20 64 65 66  61 75 6c 74 20 2a 4f 50  | the default *OP|
00001310  54 20 31 2c 30 20 69 73  20 72 65 73 65 6c 65 63  |T 1,0 is reselec|
00001320  74 65 64 20 28 6c 69 6e  65 73 0d 31 30 39 30 2d  |ted (lines.1090-|
00001330  31 31 32 30 29 20 61 6e  64 20 61 20 6d 65 73 73  |1120) and a mess|
00001340  61 67 65 20 69 6e 66 6f  72 6d 69 6e 67 20 74 68  |age informing th|
00001350  65 20 75 73 65 72 20 74  68 61 74 20 74 68 65 20  |e user that the |
00001360  52 46 53 20 69 73 20 61  63 74 69 76 65 20 69 73  |RFS is active is|
00001370  0d 70 72 69 6e 74 65 64  20 28 6c 69 6e 65 73 20  |.printed (lines |
00001380  31 31 33 30 2d 31 31 39  30 29 2e 20 54 68 65 20  |1130-1190). The |
00001390  74 77 6f 20 7a 65 72 6f  20 70 61 67 65 20 62 79  |two zero page by|
000013a0  74 65 73 20 75 73 65 64  20 62 79 20 74 68 65 20  |tes used by the |
000013b0  70 72 69 6e 74 0d 73 75  62 72 6f 75 74 69 6e 65  |print.subroutine|
000013c0  20 61 72 65 20 72 65 73  74 6f 72 65 64 20 28 6c  | are restored (l|
000013d0  69 6e 65 73 20 31 32 30  30 2d 31 32 33 30 29 2c  |ines 1200-1230),|
000013e0  20 74 68 65 20 6b 65 79  62 6f 61 72 64 20 69 73  | the keyboard is|
000013f0  20 72 65 2d 65 6e 61 62  6c 65 64 0d 28 6c 69 6e  | re-enabled.(lin|
00001400  65 73 20 31 32 34 30 2d  31 32 37 30 29 2c 20 61  |es 1240-1270), a|
00001410  6e 64 20 74 68 65 20 73  74 61 63 6b 20 62 61 6c  |nd the stack bal|
00001420  61 6e 63 65 64 20 62 65  66 6f 72 65 20 72 65 74  |anced before ret|
00001430  75 72 6e 69 6e 67 20 63  6f 6e 74 72 6f 6c 20 74  |urning control t|
00001440  6f 0d 74 68 65 20 4d 4f  53 20 77 69 74 68 20 74  |o.the MOS with t|
00001450  68 65 20 61 63 63 75 6d  75 6c 61 74 6f 72 20 72  |he accumulator r|
00001460  65 73 65 74 20 74 6f 20  7a 65 72 6f 20 28 6c 69  |eset to zero (li|
00001470  6e 65 73 20 31 32 38 30  2d 31 33 32 30 29 2e 0d  |nes 1280-1320)..|
00001480  0d 20 20 42 4f 4f 54 52  46 53 20 69 73 20 75 73  |.  BOOTRFS is us|
00001490  65 64 20 74 6f 20 63 72  65 61 74 65 20 52 46 53  |ed to create RFS|
000014a0  20 72 6f 6d 20 69 6d 61  67 65 73 20 69 6e 20 74  | rom images in t|
000014b0  68 65 20 73 61 6d 65 20  77 61 79 20 74 68 61 74  |he same way that|
000014c0  0d 52 46 53 48 45 41 44  20 77 61 73 20 75 73 65  |.RFSHEAD was use|
000014d0  64 20 69 6e 20 6d 6f 64  75 6c 65 20 31 38 2e 20  |d in module 18. |
000014e0  4c 6f 61 64 20 74 68 65  20 72 6f 6d 20 69 6d 61  |Load the rom ima|
000014f0  67 65 20 63 72 65 61 74  65 64 20 62 79 20 42 4f  |ge created by BO|
00001500  4f 54 52 46 53 0d 69 6e  74 6f 20 73 69 64 65 77  |OTRFS.into sidew|
00001510  61 79 73 20 72 61 6d 20  61 6e 64 20 70 72 65 73  |ays ram and pres|
00001520  73 20 43 74 72 6c 2b 52  2b 42 72 65 61 6b 20 74  |s Ctrl+R+Break t|
00001530  6f 20 73 65 6c 65 63 74  20 61 6e 64 20 63 61 74  |o select and cat|
00001540  61 6c 6f 67 75 65 20 74  68 65 0d 52 46 53 2e 20  |alogue the.RFS. |
00001550  49 66 20 79 6f 75 20 75  73 65 20 74 68 65 20 70  |If you use the p|
00001560  72 6f 67 72 61 6d 20 44  45 4d 4f 20 79 6f 75 20  |rogram DEMO you |
00001570  73 68 6f 75 6c 64 20 67  65 74 20 61 20 73 63 72  |should get a scr|
00001580  65 65 6e 20 64 69 73 70  6c 61 79 0d 73 69 6d 69  |een display.simi|
00001590  6c 61 72 20 74 6f 20 74  68 61 74 20 69 6e 20 66  |lar to that in f|
000015a0  69 67 75 72 65 20 31 39  2e 32 2e 0d 0d 0d 0d 0d  |igure 19.2......|
000015b0  0d 41 63 6f 72 6e 20 54  55 42 45 20 36 35 30 32  |.Acorn TUBE 6502|
000015c0  20 36 34 4b 0d 0d 52 4f  4d 20 46 69 6c 69 6e 67  | 64K..ROM Filing|
000015d0  20 53 79 73 74 65 6d 20  43 61 74 61 6c 6f 67 75  | System Catalogu|
000015e0  65 0d 0d 44 45 4d 4f 20  20 20 20 20 20 20 30 38  |e..DEMO       08|
000015f0  20 30 38 44 31 20 20 20  20 30 30 30 30 31 39 30  | 08D1    0000190|
00001600  30 20 30 30 30 30 32 31  39 34 0d 0d 52 4f 4d 20  |0 00002194..ROM |
00001610  46 69 6c 69 6e 67 20 53  79 73 74 65 6d 20 61 63  |Filing System ac|
00001620  74 69 76 65 0d 0d 42 41  53 49 43 0d 0d 3e 0d 0d  |tive..BASIC..>..|
00001630  46 69 67 75 72 65 20 31  39 2e 32 20 20 54 68 65  |Figure 19.2  The|
00001640  20 64 69 73 70 6c 61 79  20 61 66 74 65 72 20 43  | display after C|
00001650  74 72 6c 2b 52 2b 42 72  65 61 6b 2e 0d 2d 2d 2d  |trl+R+Break..---|
00001660  2d 2d 2d 2d 2d 2d 2d 2d  20 20 2d 2d 2d 2d 2d 2d  |--------  ------|
00001670  2d 2d 2d 2d 2d 2d 2d 2d  2d 2d 2d 2d 2d 2d 2d 2d  |----------------|
00001680  2d 2d 2d 2d 2d 2d 2d 2d  2d 0d 0d 0d 0d 0d 20 20  |---------.....  |
00001690  57 69 74 68 20 74 68 65  20 52 46 53 20 61 63 74  |With the RFS act|
000016a0  69 76 65 20 79 6f 75 20  63 61 6e 20 72 75 6e 20  |ive you can run |
000016b0  74 68 65 20 64 65 6d 6f  6e 73 74 72 61 74 69 6f  |the demonstratio|
000016c0  6e 20 70 72 6f 67 72 61  6d 20 62 79 20 74 79 70  |n program by typ|
000016d0  69 6e 67 0d 43 48 41 49  4e 20 22 44 45 4d 4f 22  |ing.CHAIN "DEMO"|
000016e0  20 6f 72 20 2a 52 55 4e  20 22 44 45 4d 4f 22 2e  | or *RUN "DEMO".|
000016f0  20 54 68 65 20 73 75 70  70 6c 69 65 64 20 42 41  | The supplied BA|
00001700  53 49 43 20 70 72 6f 67  72 61 6d 20 44 45 4d 4f  |SIC program DEMO|
00001710  20 68 61 73 20 62 65 65  6e 0d 77 72 69 74 74 65  | has been.writte|
00001720  6e 20 73 6f 20 74 68 61  74 20 69 74 20 63 61 6e  |n so that it can|
00001730  20 62 65 20 2a 52 55 4e  20 61 73 20 77 65 6c 6c  | be *RUN as well|
00001740  20 61 73 20 63 68 61 69  6e 65 64 2e 20 4d 6f 73  | as chained. Mos|
00001750  74 20 42 41 53 49 43 20  70 72 6f 67 72 61 6d 73  |t BASIC programs|
00001760  0d 63 61 6e 20 6f 6e 6c  79 20 62 65 20 63 68 61  |.can only be cha|
00001770  69 6e 65 64 20 66 72 6f  6d 20 74 68 65 20 52 46  |ined from the RF|
00001780  53 2c 20 6f 72 20 61 6e  79 20 6f 74 68 65 72 20  |S, or any other |
00001790  66 69 6c 69 6e 67 20 73  79 73 74 65 6d 73 2e 0d  |filing systems..|
000017a0  0d 0d 0d 0d 0d 0d 20 20  20 31 30 20 52 45 4d 3a  |......   10 REM:|
000017b0  20 42 4f 4f 54 52 46 53  0d 20 20 20 32 30 20 4d  | BOOTRFS.   20 M|
000017c0  4f 44 45 37 0d 20 20 20  33 30 20 48 49 4d 45 4d  |ODE7.   30 HIMEM|
000017d0  3d 26 33 43 30 30 0d 20  20 20 34 30 20 64 69 66  |=&3C00.   40 dif|
000017e0  66 3d 26 38 30 30 30 2d  48 49 4d 45 4d 0d 20 20  |f=&8000-HIMEM.  |
000017f0  20 35 30 20 48 25 3d 48  49 4d 45 4d 0d 20 20 20  | 50 H%=HIMEM.   |
00001800  36 30 20 61 64 64 72 65  73 73 3d 26 37 30 0d 20  |60 address=&70. |
00001810  20 20 37 30 20 72 6f 6d  6e 75 6d 62 65 72 3d 26  |  70 romnumber=&|
00001820  46 34 0d 20 20 20 38 30  20 70 68 72 6f 6d 3d 26  |F4.   80 phrom=&|
00001830  46 35 0d 20 20 20 39 30  20 72 6f 6d 70 6f 69 6e  |F5.   90 rompoin|
00001840  74 3d 26 46 36 0d 20 20  31 30 30 20 6f 73 61 73  |t=&F6.  100 osas|
00001850  63 69 3d 26 46 46 45 33  0d 20 20 31 31 30 20 6f  |ci=&FFE3.  110 o|
00001860  73 6e 65 77 6c 3d 26 46  46 45 37 0d 20 20 31 32  |snewl=&FFE7.  12|
00001870  30 20 6f 73 62 79 74 65  3d 26 46 46 46 34 0d 20  |0 osbyte=&FFF4. |
00001880  20 31 33 30 20 6f 73 63  6c 69 3d 26 46 46 46 37  | 130 oscli=&FFF7|
00001890  0d 20 20 31 34 30 20 46  4f 52 20 70 61 73 73 20  |.  140 FOR pass |
000018a0  3d 20 30 20 54 4f 20 32  20 53 54 45 50 20 32 0d  |= 0 TO 2 STEP 2.|
000018b0  20 20 31 35 30 20 50 25  3d 48 49 4d 45 4d 0d 20  |  150 P%=HIMEM. |
000018c0  20 31 36 30 20 5b 20 20  20 20 20 20 20 4f 50 54  | 160 [       OPT|
000018d0  20 70 61 73 73 0d 20 20  31 37 30 20 20 20 20 20  | pass.  170     |
000018e0  20 20 20 20 42 52 4b 0d  20 20 31 38 30 20 20 20  |    BRK.  180   |
000018f0  20 20 20 20 20 20 42 52  4b 0d 20 20 31 39 30 20  |      BRK.  190 |
00001900  20 20 20 20 20 20 20 20  42 52 4b 0d 20 20 32 30  |        BRK.  20|
00001910  30 20 20 20 20 20 20 20  20 20 4a 4d 50 20 73 65  |0         JMP se|
00001920  72 76 69 63 65 2b 64 69  66 66 0d 20 20 32 31 30  |rvice+diff.  210|
00001930  20 20 20 20 20 20 20 20  20 4f 50 54 20 46 4e 65  |         OPT FNe|
00001940  71 75 62 28 26 38 32 29  0d 20 20 32 32 30 20 20  |qub(&82).  220  |
00001950  20 20 20 20 20 20 20 4f  50 54 20 46 4e 65 71 75  |       OPT FNequ|
00001960  62 28 28 63 6f 70 79 72  69 67 68 74 2b 64 69 66  |b((copyright+dif|
00001970  66 29 20 4d 4f 44 20 32  35 36 29 0d 20 20 32 33  |f) MOD 256).  23|
00001980  30 20 20 20 20 20 20 20  20 20 42 52 4b 0d 20 20  |0         BRK.  |
00001990  32 34 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |240         OPT |
000019a0  46 4e 65 71 75 73 28 22  42 4f 4f 54 52 46 53 22  |FNequs("BOOTRFS"|
000019b0  29 0d 20 20 32 35 30 20  2e 63 6f 70 79 72 69 67  |).  250 .copyrig|
000019c0  68 74 0d 20 20 32 36 30  20 20 20 20 20 20 20 20  |ht.  260        |
000019d0  20 42 52 4b 0d 20 20 32  37 30 20 20 20 20 20 20  | BRK.  270      |
000019e0  20 20 20 4f 50 54 20 46  4e 65 71 75 73 28 22 28  |   OPT FNequs("(|
000019f0  43 29 20 47 6f 72 64 6f  6e 20 48 6f 72 73 69 6e  |C) Gordon Horsin|
00001a00  67 74 6f 6e 20 31 39 38  37 22 29 0d 20 20 32 38  |gton 1987").  28|
00001a10  30 20 20 20 20 20 20 20  20 20 42 52 4b 0d 20 20  |0         BRK.  |
00001a20  32 39 30 20 2e 73 65 72  76 69 63 65 0d 20 20 33  |290 .service.  3|
00001a30  30 30 20 20 20 20 20 20  20 20 20 50 48 41 0d 20  |00         PHA. |
00001a40  20 33 31 30 20 20 20 20  20 20 20 20 20 43 4d 50  | 310         CMP|
00001a50  20 23 31 33 0d 20 20 33  32 30 20 20 20 20 20 20  | #13.  320      |
00001a60  20 20 20 42 4e 45 20 66  6f 75 72 74 65 65 6e 0d  |   BNE fourteen.|
00001a70  20 20 33 33 30 20 20 20  20 20 20 20 20 20 54 59  |  330         TY|
00001a80  41 0d 20 20 33 34 30 20  20 20 20 20 20 20 20 20  |A.  340         |
00001a90  45 4f 52 20 23 26 46 0d  20 20 33 35 30 20 20 20  |EOR #&F.  350   |
00001aa0  20 20 20 20 20 20 43 4d  50 20 72 6f 6d 6e 75 6d  |      CMP romnum|
00001ab0  62 65 72 0d 20 20 33 36  30 20 20 20 20 20 20 20  |ber.  360       |
00001ac0  20 20 42 43 43 20 6f 75  74 0d 20 20 33 37 30 20  |  BCC out.  370 |
00001ad0  20 20 20 20 20 20 20 20  4c 44 41 20 23 28 6c 61  |        LDA #(la|
00001ae0  73 74 62 79 74 65 2b 64  69 66 66 29 20 4d 4f 44  |stbyte+diff) MOD|
00001af0  20 32 35 36 0d 20 20 33  38 30 20 20 20 20 20 20  | 256.  380      |
00001b00  20 20 20 53 54 41 20 72  6f 6d 70 6f 69 6e 74 0d  |   STA rompoint.|
00001b10  20 20 33 39 30 20 20 20  20 20 20 20 20 20 4c 44  |  390         LD|
00001b20  41 20 23 28 6c 61 73 74  62 79 74 65 2b 64 69 66  |A #(lastbyte+dif|
00001b30  66 29 20 44 49 56 20 32  35 36 0d 20 20 34 30 30  |f) DIV 256.  400|
00001b40  20 20 20 20 20 20 20 20  20 53 54 41 20 72 6f 6d  |         STA rom|
00001b50  70 6f 69 6e 74 2b 31 0d  20 20 34 31 30 20 20 20  |point+1.  410   |
00001b60  20 20 20 20 20 20 4c 44  41 20 72 6f 6d 6e 75 6d  |      LDA romnum|
00001b70  62 65 72 0d 20 20 34 32  30 20 20 20 20 20 20 20  |ber.  420       |
00001b80  20 20 45 4f 52 20 23 26  46 0d 20 20 34 33 30 20  |  EOR #&F.  430 |
00001b90  20 20 20 20 20 20 20 20  53 54 41 20 70 68 72 6f  |        STA phro|
00001ba0  6d 0d 20 20 34 34 30 20  2e 65 78 69 74 0d 20 20  |m.  440 .exit.  |
00001bb0  34 35 30 20 20 20 20 20  20 20 20 20 50 4c 41 0d  |450         PLA.|
00001bc0  20 20 34 36 30 20 20 20  20 20 20 20 20 20 4c 44  |  460         LD|
00001bd0  41 20 23 30 0d 20 20 34  37 30 20 20 20 20 20 20  |A #0.  470      |
00001be0  20 20 20 52 54 53 0d 20  20 34 38 30 20 2e 66 6f  |   RTS.  480 .fo|
00001bf0  75 72 74 65 65 6e 0d 20  20 34 39 30 20 20 20 20  |urteen.  490    |
00001c00  20 20 20 20 20 43 4d 50  20 23 31 34 0d 20 20 35  |     CMP #14.  5|
00001c10  30 30 20 20 20 20 20 20  20 20 20 42 4e 45 20 74  |00         BNE t|
00001c20  72 79 74 68 72 65 65 0d  20 20 35 31 30 20 20 20  |rythree.  510   |
00001c30  20 20 20 20 20 20 4c 44  41 20 70 68 72 6f 6d 0d  |      LDA phrom.|
00001c40  20 20 35 32 30 20 20 20  20 20 20 20 20 20 45 4f  |  520         EO|
00001c50  52 20 23 26 46 0d 20 20  35 33 30 20 20 20 20 20  |R #&F.  530     |
00001c60  20 20 20 20 43 4d 50 20  72 6f 6d 6e 75 6d 62 65  |    CMP romnumbe|
00001c70  72 0d 20 20 35 34 30 20  20 20 20 20 20 20 20 20  |r.  540         |
00001c80  42 4e 45 20 6f 75 74 0d  20 20 35 35 30 20 20 20  |BNE out.  550   |
00001c90  20 20 20 20 20 20 4c 44  59 20 23 30 0d 20 20 35  |      LDY #0.  5|
00001ca0  36 30 20 20 20 20 20 20  20 20 20 4c 44 41 20 28  |60         LDA (|
00001cb0  72 6f 6d 70 6f 69 6e 74  29 2c 59 0d 20 20 35 37  |rompoint),Y.  57|
00001cc0  30 20 20 20 20 20 20 20  20 20 54 41 59 0d 20 20  |0         TAY.  |
00001cd0  35 38 30 20 20 20 20 20  20 20 20 20 49 4e 43 20  |580         INC |
00001ce0  72 6f 6d 70 6f 69 6e 74  0d 20 20 35 39 30 20 20  |rompoint.  590  |
00001cf0  20 20 20 20 20 20 20 42  4e 45 20 65 78 69 74 0d  |       BNE exit.|
00001d00  20 20 36 30 30 20 20 20  20 20 20 20 20 20 49 4e  |  600         IN|
00001d10  43 20 72 6f 6d 70 6f 69  6e 74 2b 31 0d 20 20 36  |C rompoint+1.  6|
00001d20  31 30 20 20 20 20 20 20  20 20 20 4a 4d 50 20 65  |10         JMP e|
00001d30  78 69 74 2b 64 69 66 66  0d 20 20 36 32 30 20 2e  |xit+diff.  620 .|
00001d40  6f 75 74 0d 20 20 36 33  30 20 20 20 20 20 20 20  |out.  630       |
00001d50  20 20 50 4c 41 0d 20 20  36 34 30 20 20 20 20 20  |  PLA.  640     |
00001d60  20 20 20 20 52 54 53 0d  20 20 36 35 30 20 2e 74  |    RTS.  650 .t|
00001d70  72 79 74 68 72 65 65 0d  20 20 36 36 30 20 20 20  |rythree.  660   |
00001d80  20 20 20 20 20 20 43 4d  50 20 23 33 0d 20 20 36  |      CMP #3.  6|
00001d90  37 30 20 20 20 20 20 20  20 20 20 42 4e 45 20 6f  |70         BNE o|
00001da0  75 74 0d 20 20 36 38 30  20 20 20 20 20 20 20 20  |ut.  680        |
00001db0  20 54 58 41 0d 20 20 36  39 30 20 20 20 20 20 20  | TXA.  690      |
00001dc0  20 20 20 50 48 41 0d 20  20 37 30 30 20 20 20 20  |   PHA.  700    |
00001dd0  20 20 20 20 20 54 59 41  0d 20 20 37 31 30 20 20  |     TYA.  710  |
00001de0  20 20 20 20 20 20 20 50  48 41 0d 20 20 37 32 30  |       PHA.  720|
00001df0  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 26 37  |         LDA #&7|
00001e00  41 0d 20 20 37 33 30 20  20 20 20 20 20 20 20 20  |A.  730         |
00001e10  4a 53 52 20 6f 73 62 79  74 65 0d 20 20 37 34 30  |JSR osbyte.  740|
00001e20  20 20 20 20 20 20 20 20  20 43 50 58 20 23 26 33  |         CPX #&3|
00001e30  33 20 20 20 20 20 20 5c  20 49 73 20 69 74 20 52  |3      \ Is it R|
00001e40  20 42 72 65 61 6b 3f 0d  20 20 37 35 30 20 20 20  | Break?.  750   |
00001e50  20 20 20 20 20 20 42 45  51 20 72 62 72 65 61 6b  |      BEQ rbreak|
00001e60  0d 20 20 37 36 30 20 20  20 20 20 20 20 20 20 50  |.  760         P|
00001e70  4c 41 0d 20 20 37 37 30  20 20 20 20 20 20 20 20  |LA.  770        |
00001e80  20 54 41 59 0d 20 20 37  38 30 20 20 20 20 20 20  | TAY.  780      |
00001e90  20 20 20 50 4c 41 0d 20  20 37 39 30 20 20 20 20  |   PLA.  790    |
00001ea0  20 20 20 20 20 54 41 58  0d 20 20 38 30 30 20 20  |     TAX.  800  |
00001eb0  20 20 20 20 20 20 20 50  4c 41 0d 20 20 38 31 30  |       PLA.  810|
00001ec0  20 20 20 20 20 20 20 20  20 52 54 53 0d 20 20 38  |         RTS.  8|
00001ed0  32 30 20 2e 72 62 72 65  61 6b 0d 20 20 38 33 30  |20 .rbreak.  830|
00001ee0  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 26 43  |         LDA #&C|
00001ef0  39 0d 20 20 38 34 30 20  20 20 20 20 20 20 20 20  |9.  840         |
00001f00  4c 44 58 20 23 31 0d 20  20 38 35 30 20 20 20 20  |LDX #1.  850    |
00001f10  20 20 20 20 20 4c 44 59  20 23 30 0d 20 20 38 36  |     LDY #0.  86|
00001f20  30 20 20 20 20 20 20 20  20 20 4a 53 52 20 6f 73  |0         JSR os|
00001f30  62 79 74 65 20 20 20 20  5c 20 44 69 73 61 62 6c  |byte    \ Disabl|
00001f40  65 20 6b 65 79 62 6f 61  72 64 0d 20 20 38 37 30  |e keyboard.  870|
00001f50  20 20 20 20 20 20 20 20  20 4c 44 41 20 23 26 30  |         LDA #&0|
00001f60  46 0d 20 20 38 38 30 20  20 20 20 20 20 20 20 20  |F.  880         |
00001f70  4c 44 58 20 23 30 0d 20  20 38 39 30 20 20 20 20  |LDX #0.  890    |
00001f80  20 20 20 20 20 4a 53 52  20 6f 73 62 79 74 65 20  |     JSR osbyte |
00001f90  20 20 20 5c 20 46 6c 75  73 68 20 61 6c 6c 20 62  |   \ Flush all b|
00001fa0  75 66 66 65 72 73 0d 20  20 39 30 30 20 20 20 20  |uffers.  900    |
00001fb0  20 20 20 20 20 4c 44 41  20 61 64 64 72 65 73 73  |     LDA address|
00001fc0  0d 20 20 39 31 30 20 20  20 20 20 20 20 20 20 50  |.  910         P|
00001fd0  48 41 0d 20 20 39 32 30  20 20 20 20 20 20 20 20  |HA.  920        |
00001fe0  20 4c 44 41 20 61 64 64  72 65 73 73 2b 31 0d 20  | LDA address+1. |
00001ff0  20 39 33 30 20 20 20 20  20 20 20 20 20 50 48 41  | 930         PHA|
00002000  0d 20 20 39 34 30 20 20  20 20 20 20 20 20 20 4c  |.  940         L|
00002010  44 58 20 23 28 72 66 73  2b 64 69 66 66 29 20 4d  |DX #(rfs+diff) M|
00002020  4f 44 20 32 35 36 0d 20  20 39 35 30 20 20 20 20  |OD 256.  950    |
00002030  20 20 20 20 20 4c 44 59  20 23 28 72 66 73 2b 64  |     LDY #(rfs+d|
00002040  69 66 66 29 20 44 49 56  20 32 35 36 0d 20 20 39  |iff) DIV 256.  9|
00002050  36 30 20 20 20 20 20 20  20 20 20 4a 53 52 20 70  |60         JSR p|
00002060  72 69 6e 74 2b 64 69 66  66 0d 20 20 39 37 30 20  |rint+diff.  970 |
00002070  20 20 20 20 20 20 20 20  4c 44 58 20 23 28 63 61  |        LDX #(ca|
00002080  74 2b 64 69 66 66 29 20  4d 4f 44 20 32 35 36 0d  |t+diff) MOD 256.|
00002090  20 20 39 38 30 20 20 20  20 20 20 20 20 20 4c 44  |  980         LD|
000020a0  59 20 23 28 63 61 74 2b  64 69 66 66 29 20 44 49  |Y #(cat+diff) DI|
000020b0  56 20 32 35 36 0d 20 20  39 39 30 20 20 20 20 20  |V 256.  990     |
000020c0  20 20 20 20 4a 53 52 20  70 72 69 6e 74 2b 64 69  |    JSR print+di|
000020d0  66 66 0d 20 31 30 30 30  20 20 20 20 20 20 20 20  |ff. 1000        |
000020e0  20 4c 44 41 20 23 26 38  44 0d 20 31 30 31 30 20  | LDA #&8D. 1010 |
000020f0  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 62 79  |        JSR osby|
00002100  74 65 20 20 20 20 5c 20  53 65 6c 65 63 74 20 52  |te    \ Select R|
00002110  46 53 0d 20 31 30 32 30  20 20 20 20 20 20 20 20  |FS. 1020        |
00002120  20 4c 44 41 20 23 26 38  42 0d 20 31 30 33 30 20  | LDA #&8B. 1030 |
00002130  20 20 20 20 20 20 20 20  4c 44 58 20 23 31 0d 20  |        LDX #1. |
00002140  31 30 34 30 20 20 20 20  20 20 20 20 20 4c 44 59  |1040         LDY|
00002150  20 23 32 0d 20 31 30 35  30 20 20 20 20 20 20 20  | #2. 1050       |
00002160  20 20 4a 53 52 20 6f 73  62 79 74 65 20 20 20 20  |  JSR osbyte    |
00002170  5c 20 2a 4f 50 54 31 2c  32 0d 20 31 30 36 30 20  |\ *OPT1,2. 1060 |
00002180  20 20 20 20 20 20 20 20  4c 44 58 20 23 28 64 6f  |        LDX #(do|
00002190  74 2b 64 69 66 66 29 20  4d 4f 44 20 32 35 36 0d  |t+diff) MOD 256.|
000021a0  20 31 30 37 30 20 20 20  20 20 20 20 20 20 4c 44  | 1070         LD|
000021b0  59 20 23 28 64 6f 74 2b  64 69 66 66 29 20 44 49  |Y #(dot+diff) DI|
000021c0  56 20 32 35 36 0d 20 31  30 38 30 20 20 20 20 20  |V 256. 1080     |
000021d0  20 20 20 20 4a 53 52 20  6f 73 63 6c 69 20 20 20  |    JSR oscli   |
000021e0  20 20 5c 20 43 61 74 61  6c 6f 67 75 65 20 52 46  |  \ Catalogue RF|
000021f0  53 0d 20 31 30 39 30 20  20 20 20 20 20 20 20 20  |S. 1090         |
00002200  4c 44 41 20 23 26 38 42  0d 20 31 31 30 30 20 20  |LDA #&8B. 1100  |
00002210  20 20 20 20 20 20 20 4c  44 58 20 23 30 0d 20 31  |       LDX #0. 1|
00002220  31 31 30 20 20 20 20 20  20 20 20 20 4c 44 59 20  |110         LDY |
00002230  23 30 0d 20 31 31 32 30  20 20 20 20 20 20 20 20  |#0. 1120        |
00002240  20 4a 53 52 20 6f 73 62  79 74 65 20 20 20 20 5c  | JSR osbyte    \|
00002250  20 2a 4f 50 54 20 31 2c  30 0d 20 31 31 33 30 20  | *OPT 1,0. 1130 |
00002260  20 20 20 20 20 20 20 20  4a 53 52 20 6f 73 6e 65  |        JSR osne|
00002270  77 6c 0d 20 31 31 34 30  20 20 20 20 20 20 20 20  |wl. 1140        |
00002280  20 4c 44 58 20 23 28 72  66 73 2b 64 69 66 66 29  | LDX #(rfs+diff)|
00002290  20 4d 4f 44 20 32 35 36  0d 20 31 31 35 30 20 20  | MOD 256. 1150  |
000022a0  20 20 20 20 20 20 20 4c  44 59 20 23 28 72 66 73  |       LDY #(rfs|
000022b0  2b 64 69 66 66 29 20 44  49 56 20 32 35 36 0d 20  |+diff) DIV 256. |
000022c0  31 31 36 30 20 20 20 20  20 20 20 20 20 4a 53 52  |1160         JSR|
000022d0  20 70 72 69 6e 74 2b 64  69 66 66 0d 20 31 31 37  | print+diff. 117|
000022e0  30 20 20 20 20 20 20 20  20 20 4c 44 58 20 23 28  |0         LDX #(|
000022f0  61 63 74 2b 64 69 66 66  29 20 4d 4f 44 20 32 35  |act+diff) MOD 25|
00002300  36 0d 20 31 31 38 30 20  20 20 20 20 20 20 20 20  |6. 1180         |
00002310  4c 44 59 20 23 28 61 63  74 2b 64 69 66 66 29 20  |LDY #(act+diff) |
00002320  44 49 56 20 32 35 36 0d  20 31 31 39 30 20 20 20  |DIV 256. 1190   |
00002330  20 20 20 20 20 20 4a 53  52 20 70 72 69 6e 74 2b  |      JSR print+|
00002340  64 69 66 66 0d 20 31 32  30 30 20 20 20 20 20 20  |diff. 1200      |
00002350  20 20 20 50 4c 41 0d 20  31 32 31 30 20 20 20 20  |   PLA. 1210    |
00002360  20 20 20 20 20 53 54 41  20 61 64 64 72 65 73 73  |     STA address|
00002370  2b 31 0d 20 31 32 32 30  20 20 20 20 20 20 20 20  |+1. 1220        |
00002380  20 50 4c 41 0d 20 31 32  33 30 20 20 20 20 20 20  | PLA. 1230      |
00002390  20 20 20 53 54 41 20 61  64 64 72 65 73 73 0d 20  |   STA address. |
000023a0  31 32 34 30 20 20 20 20  20 20 20 20 20 4c 44 41  |1240         LDA|
000023b0  20 23 26 43 39 0d 20 31  32 35 30 20 20 20 20 20  | #&C9. 1250     |
000023c0  20 20 20 20 4c 44 58 20  23 30 0d 20 31 32 36 30  |    LDX #0. 1260|
000023d0  20 20 20 20 20 20 20 20  20 4c 44 59 20 23 30 0d  |         LDY #0.|
000023e0  20 31 32 37 30 20 20 20  20 20 20 20 20 20 4a 53  | 1270         JS|
000023f0  52 20 6f 73 62 79 74 65  20 20 20 20 5c 20 45 6e  |R osbyte    \ En|
00002400  61 62 6c 65 20 6b 65 79  62 6f 61 72 64 0d 20 31  |able keyboard. 1|
00002410  32 38 30 20 20 20 20 20  20 20 20 20 50 4c 41 0d  |280         PLA.|
00002420  20 31 32 39 30 20 20 20  20 20 20 20 20 20 50 4c  | 1290         PL|
00002430  41 0d 20 31 33 30 30 20  20 20 20 20 20 20 20 20  |A. 1300         |
00002440  50 4c 41 0d 20 31 33 31  30 20 20 20 20 20 20 20  |PLA. 1310       |
00002450  20 20 4c 44 41 20 23 30  0d 20 31 33 32 30 20 20  |  LDA #0. 1320  |
00002460  20 20 20 20 20 20 20 52  54 53 0d 20 31 33 33 30  |       RTS. 1330|
00002470  20 2e 70 72 69 6e 74 0d  20 31 33 34 30 20 20 20  | .print. 1340   |
00002480  20 20 20 20 20 20 53 54  58 20 61 64 64 72 65 73  |      STX addres|
00002490  73 0d 20 31 33 35 30 20  20 20 20 20 20 20 20 20  |s. 1350         |
000024a0  53 54 59 20 61 64 64 72  65 73 73 2b 31 0d 20 31  |STY address+1. 1|
000024b0  33 36 30 20 20 20 20 20  20 20 20 20 4c 44 59 20  |360         LDY |
000024c0  23 26 46 46 0d 20 31 33  37 30 20 2e 70 72 69 6e  |#&FF. 1370 .prin|
000024d0  74 6c 6f 6f 70 0d 20 31  33 38 30 20 20 20 20 20  |tloop. 1380     |
000024e0  20 20 20 20 49 4e 59 0d  20 31 33 39 30 20 20 20  |    INY. 1390   |
000024f0  20 20 20 20 20 20 4c 44  41 20 28 61 64 64 72 65  |      LDA (addre|
00002500  73 73 29 2c 59 0d 20 31  34 30 30 20 20 20 20 20  |ss),Y. 1400     |
00002510  20 20 20 20 42 45 51 20  65 6e 64 70 72 69 6e 74  |    BEQ endprint|
00002520  0d 20 31 34 31 30 20 20  20 20 20 20 20 20 20 4a  |. 1410         J|
00002530  53 52 20 6f 73 61 73 63  69 0d 20 31 34 32 30 20  |SR osasci. 1420 |
00002540  20 20 20 20 20 20 20 20  4a 4d 50 20 70 72 69 6e  |        JMP prin|
00002550  74 6c 6f 6f 70 2b 64 69  66 66 0d 20 31 34 33 30  |tloop+diff. 1430|
00002560  20 2e 65 6e 64 70 72 69  6e 74 0d 20 31 34 34 30  | .endprint. 1440|
00002570  20 20 20 20 20 20 20 20  20 52 54 53 0d 20 31 34  |         RTS. 14|
00002580  35 30 20 2e 64 6f 74 0d  20 31 34 36 30 20 20 20  |50 .dot. 1460   |
00002590  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 73  |      OPT FNequs|
000025a0  28 22 43 41 54 22 29 0d  20 31 34 37 30 20 20 20  |("CAT"). 1470   |
000025b0  20 20 20 20 20 20 4f 50  54 20 46 4e 65 71 75 62  |      OPT FNequb|
000025c0  28 26 30 44 29 0d 20 31  34 38 30 20 2e 72 66 73  |(&0D). 1480 .rfs|
000025d0  0d 20 31 34 39 30 20 20  20 20 20 20 20 20 20 4f  |. 1490         O|
000025e0  50 54 20 46 4e 65 71 75  73 28 22 52 4f 4d 20 46  |PT FNequs("ROM F|
000025f0  69 6c 69 6e 67 20 53 79  73 74 65 6d 20 22 29 0d  |iling System ").|
00002600  20 31 35 30 30 20 20 20  20 20 20 20 20 20 42 52  | 1500         BR|
00002610  4b 0d 20 31 35 31 30 20  2e 63 61 74 0d 20 31 35  |K. 1510 .cat. 15|
00002620  32 30 20 20 20 20 20 20  20 20 20 4f 50 54 20 46  |20         OPT F|
00002630  4e 65 71 75 73 28 22 43  61 74 61 6c 6f 67 75 65  |Nequs("Catalogue|
00002640  22 29 0d 20 31 35 33 30  20 20 20 20 20 20 20 20  |"). 1530        |
00002650  20 4f 50 54 20 46 4e 65  71 75 62 28 26 30 44 29  | OPT FNequb(&0D)|
00002660  0d 20 31 35 34 30 20 20  20 20 20 20 20 20 20 42  |. 1540         B|
00002670  52 4b 0d 20 31 35 35 30  20 2e 61 63 74 0d 20 31  |RK. 1550 .act. 1|
00002680  35 36 30 20 20 20 20 20  20 20 20 20 4f 50 54 20  |560         OPT |
00002690  46 4e 65 71 75 73 28 22  61 63 74 69 76 65 22 29  |FNequs("active")|
000026a0  0d 20 31 35 37 30 20 20  20 20 20 20 20 20 20 4f  |. 1570         O|
000026b0  50 54 20 46 4e 65 71 75  77 28 26 30 44 30 44 29  |PT FNequw(&0D0D)|
000026c0  0d 20 31 35 38 30 20 20  20 20 20 20 20 20 20 42  |. 1580         B|
000026d0  52 4b 0d 20 31 35 39 30  20 2e 6c 61 73 74 62 79  |RK. 1590 .lastby|
000026e0  74 65 0d 20 31 36 30 30  20 5d 0d 20 31 36 31 30  |te. 1600 ]. 1610|
000026f0  20 4e 45 58 54 0d 20 31  36 32 30 20 4f 25 3d 6c  | NEXT. 1620 O%=l|
00002700  61 73 74 62 79 74 65 0d  20 31 36 33 30 20 43 48  |astbyte. 1630 CH|
00002710  41 49 4e 22 52 46 53 47  45 4e 22 0d 20 31 36 34  |AIN"RFSGEN". 164|
00002720  30 20 44 45 46 46 4e 65  71 75 62 28 62 79 74 65  |0 DEFFNequb(byte|
00002730  29 0d 20 31 36 35 30 20  3f 50 25 3d 62 79 74 65  |). 1650 ?P%=byte|
00002740  0d 20 31 36 36 30 20 50  25 3d 50 25 2b 31 0d 20  |. 1660 P%=P%+1. |
00002750  31 36 37 30 20 3d 70 61  73 73 0d 20 31 36 38 30  |1670 =pass. 1680|
00002760  20 44 45 46 46 4e 65 71  75 77 28 77 6f 72 64 29  | DEFFNequw(word)|
00002770  0d 20 31 36 39 30 20 3f  50 25 3d 77 6f 72 64 20  |. 1690 ?P%=word |
00002780  4d 4f 44 20 32 35 36 0d  20 31 37 30 30 20 50 25  |MOD 256. 1700 P%|
00002790  3f 31 3d 77 6f 72 64 20  44 49 56 20 32 35 36 0d  |?1=word DIV 256.|
000027a0  20 31 37 31 30 20 50 25  3d 50 25 2b 32 0d 20 31  | 1710 P%=P%+2. 1|
000027b0  37 32 30 20 3d 70 61 73  73 0d 20 31 37 33 30 20  |720 =pass. 1730 |
000027c0  44 45 46 46 4e 65 71 75  64 28 64 6f 75 62 6c 65  |DEFFNequd(double|
000027d0  29 0d 20 31 37 34 30 20  21 50 25 3d 64 6f 75 62  |). 1740 !P%=doub|
000027e0  6c 65 0d 20 31 37 35 30  20 50 25 3d 50 25 2b 34  |le. 1750 P%=P%+4|
000027f0  0d 20 31 37 36 30 20 3d  70 61 73 73 0d 20 31 37  |. 1760 =pass. 17|
00002800  37 30 20 44 45 46 46 4e  65 71 75 73 28 73 74 72  |70 DEFFNequs(str|
00002810  69 6e 67 24 29 0d 20 31  37 38 30 20 24 50 25 3d  |ing$). 1780 $P%=|
00002820  73 74 72 69 6e 67 24 0d  20 31 37 39 30 20 50 25  |string$. 1790 P%|
00002830  3d 50 25 2b 4c 45 4e 28  73 74 72 69 6e 67 24 29  |=P%+LEN(string$)|
00002840  0d 20 31 38 30 30 20 3d  70 61 73 73 0d           |. 1800 =pass.|
0000284d
11-11-88/T\SWR19.m0
11-11-88/T\SWR19.m1
11-11-88/T\SWR19.m2
11-11-88/T\SWR19.m4
11-11-88/T\SWR19.m5