P721 CEEFAX 721 Tue 15 Nov 20:00/06 |B220120B|a17T/SWR19|i14Text|m10Masterin g Sideways ROM & RAM - Module 19 - Autob oot RFS÷e------------------------------- ------------------------÷e÷e Most of th e filing systems on the BBC microcompute r can be selected÷e(booted in micro-spda c( by holding down CTRL with a filing sy stem boot÷ekey and then pressing and rel easing the Break key. The DFS can be÷ebo oted with Ctrl+D+Break, the ADFS with Ct rl+F+Break, the Tape Filing÷esystem with Ctrl+Space+Break and the Network Filing system with÷eCtrl+N+Break. You might ex pect the RFS to boot with Ctrl+R+Break b qt÷eif you try it you will be disappoint ed, it does not work. The RFS is÷ethe on ly filing system that can not be booted in this way. In this÷emodule I will show you how to modify the RFS interpreter u sed in÷eModule 18 to include booting the RFS with Ctrl+R+Break.÷e÷e The BBC B i ssues service call 3 on both hard and so ft reset. The÷eMaster issues it only on hard reset. This service call is issued÷
P721 CEEFAX 721 Tue 15 Nov 20:00/04 |B220220B|a17T/SWR19|m33B4o be initialis ed on break rather÷ethan having to be re selected every time with an operating sy stem÷ecommand. Any service rom can inter cept this call to execute any÷eroutine b ut it should only trapped if a key exclu sive to that rom is÷epressed. The exampl e program BOOTRFS will intercept service call 3 and÷euse Osbyte &7A to read the internal key number of any key pressed a nd,÷eif the internal key number for "R" is found, it will select and÷ecatalogue the RFS.÷e÷e Osbyte &7A has no entry pa rameters and returns the internal key÷en umber in the X register. The internal ke y numbers are not printed in÷ethe BBC B User Guide but the INKEY numbers are lis ted in the BASIC÷ekeyword section. The I NKEY number can be converted into an Int ernal÷eKey Number by Exclusive ORing it with &FF For example, the INKEY÷enumber for R is -52. To find the internal key number type:÷e÷e>PRINT |÷ -52 EOR &FF÷e FFFFFF33÷e>÷e÷eand the answer, ignoring
P721 CEEFAX 721 Tue 15 Nov 20:00/23 |B220320B|a17T/SGR19|m3767 19.1 shows th e coding that needs to be added to a SWR ÷einterpreter to intercept service call 3 and auto-boot the RFS on÷eCtrl+R+Break . The auto-boot coding can be included i n any SWR÷einterpreter, it does not have to be in a rom with RFS files. Figure÷e 19.1 illustrates that if, after intercep ting service call 3, Osbyte÷e&7A returns with X=&33 then Ctrl+R+Break has been p ressed and your÷eprogram can use Osbyte &8D to select the RFS. The routine retur ns÷econtrol to the MOS after balancing t he stack and reseting the÷eaccultlator t o zero.÷e÷e÷e .trythree÷e CMP £3 \ is it autoboot?÷e BNE ou t \ branch if not autoboot÷e PHA \ store A÷e TXA÷e PHA \ store X÷e TYA÷e PHA \ store Y÷e LDA £&7A \ Osbyte &7A, no pa rameters÷e JSR &FFF4 \ read i nternal key number÷e CPX £&33 \ has Ctrl+R+Break been pressed?÷e
P721 CEEFAX 721 Tue 15 Nov 20:01/02 |B220420B|a17T/SWR19|m3B1B÷e PLA \ pull Y÷e TAY \ restore Y÷e PLA \ p ull X÷e TAX \ restore X ÷e PLA \ restore A÷e RTS \ return to MOS÷e.rbr eak÷e LDA £&8D \ Osbyte &8D, no parameters÷e JSR &FFF4 \ *ROM÷e PLA \ discard Y÷ e PLA \ discard X÷e PLA \ discard A÷e L DA £0 \ service recognised÷e.out÷ e RTS \ return to MOS÷e ÷eFigure 19.1 RFS Auto-boot SWR interpr eter.÷e----------- -------------------- ----------÷e÷e÷e÷e The auto-boot routin e in figure 19.1 has been adapted for us e in the÷eauto-boot RFS header program B OOTRFS. This program must ssed with the÷ eRFSGEN program (introduced in Module 18 ) to create RFS rom images. It÷ecan only be used with RFSGEN and should replace the RFSHEAD program to÷ecreate an auto-b ooting RFS rom image If RFS rom images
P721 CEEFAX 721 Tue 15 Nov 20:00/00 |B220520B|a17T/SWR19|m3ECAt then a rom i mage created with BOOTRFS should÷eonly b e used in one of the rom sockets. All th e other rom images÷eshould be created wi th RFSHEAD to keep their rom headers as small as÷epossible.÷e÷e BOOTRFS interce pts service call 3, selects and catalogu es the RFS÷eand exits with the RFS activ e. It uses the service call &0D and &0E÷ einterpreter introduced in Module 18.÷e÷ e Service call 3 is intercepted (line 6 60) and if Ctrl+R+Break is÷edetected (li nes 720-750) control passes to the label ".rbreak" (line÷e820). Because it can t ake a couple of seconds to catalogue the RFS the÷ekeyboard is disabled to preven t unwanted input, particularly Escape÷e( lines 830-860). The buffers are flushed (lines 870-890), the two zero÷epage byte s used by the print subroutine are store d on the stack (lines÷e900-930) and a he ader to the catalogue is printed (lines 940-990). The÷eRFS is selected (lines 10 00-1010) and the Osbyte equivalent of *O
P721 CEEFAX 721 Tue 15 Nov 20:12/20 |B220620B|a17T/SWR19|m41283ling system m essages (lines 1020-1050).÷e÷e The comm and line interpreter is instructed to ca talogue the RFS÷e(lines 1060-1080), the default *OPT 1,0 is reselected (lines÷e1 090-1120) and a message informing the us er that the RFS is active is÷eprinted (l ines 1130-1190). The two zero page bytes used by the print÷esubroutine are resto red (lines 1200-1230), the keyboard is r e-enabled÷e(lines 1240-1270), and the st ack balanced before returning control to ÷ethe MOS with the accumulator reset to zero (lines 1280-1320).÷e÷e BOOTRFS is used to create RFS rom images in the sam e way that÷eRFSHEAD was used in module 1 8. Load the rom image created by BOOTRFS ÷einto sideways ram and press Ctrl+R+Bre ak to select and catalogue the÷eRFS. If you use the program DEMO you should get a screen display÷esimilar to that in fig ure 19.2.÷e÷e÷e÷e÷e÷eAcorn TUBE 6502 64K ÷e÷eROM Filing System Catalogue÷e÷eDEMO 08 08D1 00001900 00002194÷e÷eRO
P721 CEEFAX 721 Tue 15 Nov 20:12/38 |B220720B|a17T/SWR19|m4162E÷e÷eFigure 19 .2 The display after Ctrl+R+Break.÷e--- -------- ------------------------------ -÷e÷e÷e÷e÷e With the RFS active you can run the demonstration program by typing ÷eCHAIN "DEMO" or *RUN "DEMO". The suppl ied BASIC program DEMO has been÷ewritten so that it can be *RUN as well as chain ed. Most BASIC programs÷ecan only be cha ined from the RFS, or any other filing s ystems.÷e÷e÷e÷e÷e÷e÷e 10 REM: BOOTRFS÷ e 20 MODE7÷e 30 HIMEM=&3C00÷e 40 d iff=&8000-HIMEM÷e 50 H%=HIMEM÷e 60 a ddress=&70÷e 70 romnumber=&F4÷e 80 p hrom=&F5÷e 90 rompoint=&F6÷e 100 osas ci=&FFE3÷e 110 osnewl=&FFE7÷e 120 osby te=&FFF4÷e 130 oscli=&FFF7÷e 140 FOR p ass = 0 TO 2 STEP 2÷e 150 P%=HIMEM÷e 1 60 [ OPT pass÷e 170 BRK÷e 180 BRK÷e 190 BRK÷e 200 JMP service+diff÷e 210 OPT FNequb(&82)÷e 220 OPT F Nequb( copyright+diff) MOD 256)÷e 230 BRK÷e 240 OPT FNequs("BO
P721 CEEFAX 721 Tue 15 Nov 20:13/08 |B220820B|a17T/SWR19|m419CC BRK÷e 2 70 OPT FNequs("(C) Gordon Horsin gton 1987")÷e 280 BRK÷e 290 .s ervice÷e 300 PHA÷e 310 CMP £13÷e 320 BNE fourteen÷e 330 TYA÷e 340 EOR £&F÷e 350 CMP romnumber÷e 360 BCC out÷e 370 LDA £(lastbyte +diff) MOD 256÷e 380 STA rompoi nt÷e 390 LDA £(lastbyte+diff) D IV 256÷e 400 STA rompoint+1÷e 410 LDA romnumber÷e 420 EOR £&F÷e 430 STA phrom÷e 440 .exit÷e 450 PLA÷e 460 LDA £0÷e 470 RTS÷e 480 .fourt een÷e 490 CMP £14÷e 500 BNE trythree÷e 510 LDA phrom÷ e 520 EOR £&F÷e 530 CM P romnumber÷e 540 BNE out÷e 55 0 LDY £0÷e 560 LDA (rom point),Y÷e 570 TAY÷e 580 INC rompoint÷e 590 BNE exit÷ e 600 INC rompoint+1÷e 610 JMP exit+diff÷e 620 .out÷e 630
P721 CEEFAX 721 Tue 15 Nov 20:03/00 |B220920B|a17T/SWR19|m41D6E.trythree÷e 660 CMP £3÷e 670 BNE ou t÷e 680 TXA÷e 690 PHA÷ e 700 TYA÷e 710 PHA÷e 720 LDA £&7A÷e 730 JSR osbyte÷e 740 CPX £&33 \ I s it R Break?÷e 730 BEQ rbreak÷ e 760 PLA÷e 770 TAY÷e 780 PLA÷e 790 TAX÷e 8 00 PLA÷e 810 RTS÷e 820 .rbreak÷e 830 LDA £&C9÷e 840 LDX £1÷e 850 LDY £0÷e 860 JSR osbyte \ Disable keyb oard÷e 870 LDA £&0F÷e 880 LDX £0÷e 890 JSR osbyte \ Flush all buffers÷e 900 LDA a ddress÷e 910 PHA÷e 920 LDA address+1÷e 930 PHA÷e 940 LDX £(rfs+diff) MOD 256÷e 950 LDY £(rfs+diff) DIV 256÷e 960 JSR print+diff÷e 970 LDX £(cat+diff) MOD 256÷e 980 LDY £(cat+diff) DIV 256÷e 990 JSR p rint+diff÷e 1000 LDA £&8D÷e 1010
P721 CEEFAX 721 Tue 15 Nov 20:00/06 |B220A20B|a17T/SWR19|m42113 1020 LDA £&8B÷e 1030 LDX £1÷e 1040 LDY £2÷e 1050 JSR osbyte \ *OPT1,2÷e 1060 LDX £(dot+di ff) MOD 256÷e 1070 LDY £(dot+dif f) DIV 256÷e 1080 JSR oscli \ Catalogue RFS÷e 1090 LDA £&8B÷ e 1100 LDX £0÷e 1110 LDY £0÷e 1120 JSR osbyte \ *OPT 1,0÷e 1130 JSR osnewl÷e 1140 LDX £(rfs+diff) MOD 256÷e 1150 LDY £(rfs+diff) DIV 256÷e 1160 JSR print+diff÷e 1170 LDX £(a ct+diff) MOD 256÷e 1180 LDY £(ac t+diff) DIV 256÷e 1190 JSR print +diff÷e 1200 PLA÷e 1210 STA address+1÷e 1220 PLA÷e 1230 STA address÷e 1240 LDA £ &C9÷e 1250 LDX £0÷e 1260 LDY £0÷e 1270 JSR osbyte \ E nable keyboard÷e 1280 PLA÷e 1290 PLA÷e 1300 PLA÷e 1310 LDA £0÷e 1320 RTS÷e 1330 .print÷e 1340 STX address÷e 1350
P721 CEEFAX 721 Tue 15 Nov 20:00/05 |B220B20B|a17T/SWR19|m424BA LDY £&FF÷e 1370 Nprintloop÷e 1380 INY÷e 139 0 LDA (address),Y÷e 1400 BEQ endprint÷e 1410 JSR osasci÷ e 1420 JMP printloop+diff÷e 1430 .endprint÷e 1440 RTS÷e 1450 .do t÷e 1460 OPT FNequs("CAT")÷e 147 0 OPT FNequb(&0D)÷e 1480 .rfs÷e 1490 OPT FNequs("ROM Filing Syst em ")÷e 1500 BRK÷e 1510 .cat÷e 1 520 OPT FNequs("Catalogue")÷e 15 30 OPT FNequb(&0D)÷e 1540 BRK÷e 1550 .act÷e 1560 OPT FNe qus("active")÷e 1570 OPT FNequw( &0D0D)÷e 1580 BRK÷e 1590 .lastby te÷e 1600 ]÷e 1610 NEXT÷e 1620 O%=lastby te÷e 1630 CHAIN"RFSGENb÷e 1640 DEFFNequb (byte)÷e 1650 ?P%=byte÷e 1660 P%=P%+1÷e 1670 =pass÷e 1680 DEFFNequw word)÷e 1690 ?P%=word MOD 256÷e 1700 P%?1=word DIV 2 56÷e 1710 P%=P%+2÷e 1720 =pass÷e 1730 DE FFNequd(double)÷e 1740 !P%=double÷e 1750 P%=P%+4÷e 1760 =pass÷e 1770 DEFFNequs(s tring$)÷e 1780 $P%=string$÷e 1790 P%=P%+