>LIST 1000REM 1001Bit1=1:ServiceBit=128 1010[OPT Pass 1020\ 1030.START 1040 Nop: Nop: Nop 1050 Jmp service \Service ROM handler 1060 EQUB Bit1+ServiceBit 1070 EQUB copyr-START 1080 EQUB 0 \Version number 1090 EQUS "Panos/UnixFS" 1100 BRK 1110 EQUS Vers$ 1120.copyr 1130 BRK \Copyright pointer points here 1140 EQUS "(C)1985 Graham Toal" 1150 BRK 1160\ 1170\ 1180\ 1200\******** In this scheme, only commands valid are when FS is selected! 1350.docommand \Check for sideways command 1360 Lda &F2 \get pointer to command 1370 Sta swzp0 1380 Lda &F3 1390 Sta swzp1 1400 Ldx #swcmds-cmdtab 1410 \Offset in cmdtab to the commands which are allowed 1420 \in this context. Note Y still offset to offered command 1430\in this context. Note Y still offset to offered command 1440 Jsr cli \Decode & execute command. Carry set if no command 1450 Bcs claimed 1460 Jmp ignore 1470\ 1480\ 1490.ignore 1500\Pull all registers off stack & return from sideways call 1510\ NB also restores A, so does not claim call 1520 Pla 1530 Tax 1540 Pla 1550 Tay 1560 Pla 1570 Rts 1580\ 1590\ 1600\ 1610.claimed \Restore all registers except A which is set to 0 to claim 1620 Pla 1630 Tax 1640 Pla 1650 Tay 1660 Pla \ old A, so discard 1670 Lda #0 1680 Rts 1690\ 1700\ 1710\ 1720\ 1730\ 1740\ 1750\Service call enters here 1760\ 1770\ Jumps out to various routines according to reason code in A 1780\ Note that Y is preserved as it is sometimes a parameter 1790\ all registers pushed on stack. 1800\ 1810.service 1820 Pha 1830 Sta swzp0 1840 Tya 1850 Pha 1860 Txa 1870 Pha 1880 Lda swzp0 1890 Cmp #swstartFS 1900 Beq dostartFS 1910 Cmp #(swtab1-swtab) DIV 2 \ Number of entries in table 1920 Bcs ignore 1930 Asl A 1940 Tax 1950 Lda swtab,X 1960 Sta swzp0 1970 Lda swtab+1,X 1980 Sta swzp1 1990 Jmp (swzp0) 2000\ 2010\ 2020\ 2030\ 2040\ 2050.dostartFS 2060 Cpy #our_fs_no 2070 Bne ignore 2080 Jsr starRS423 \ Start-up this filing system. 2090 Jmp claimed 2100\ 2110\ 2120\ 2130.dofixed \ Reserve appropriate amount of fixed workspace 2140 Pla 2150 Tax 2160 Pla 2170 Tay \ We need to change the original Y if too small 2180 Cpy #(endfixed+255) DIV 256 2190 Bcs fixed1 2200 Ldy #(endfixed+255) DIV 256 2210.fixed1 2220 Pla \ original 2230 Rts 2240\ 2250\ 2260\ 2270.doprivate 2280 Ldx &F4 \ OUR ROM number 2290 Tya 2300 Sta &0DF0,X \ Save start of our private space in romnumber'th byte 2310 \ of space at 0DF0 (X contains ROM no.) 2320 \ Top bit of this is used to indicate whether 2330 \ we have the fixed workspace - not set here => we have it 2340\ 2341 Pla: Tax 2342 Pla 2350 Clc: Adc #(private_size+255) DIV 256 2351 Tay 2352 Pla 2360 JMP Boot 2370\ 2380\ 2390\ 2400\ 2410.doboot \ Full boot not supported - auto select if T-Break or first ROM 2420 Jmp ignore \********************* TEMP! TEMP! 2430\ 2440\ 2450\ 2460\ 2470\ 2480\ 2490\ 2520\ 2530\ 2540\ 2550\ 2560.dospaceclaim \ Enters here if space being claimed from us 2570\ Hide all important variables in private space 2580\ 2590 Ldx &F4 \ ROM no. [ Is this the best place to get the No? ] 2600 Lda &0DF0,X \ Have we got the fixed workspace ? 2610 Jmp ignore \ No. 2620.release1 2630 Jmp claimed 2640\ 2650.swtab 2660 EQUW ignore \ 0 NOP 2670 EQUW dofixed \ 1 reserve fixed space 2680 EQUW doprivate \ 2 reserve private space 2690 EQUW ignore \ 3 auto boot 2700 EQUW docommand \ 4 unrecognised *COMMAND 2710 EQUW ignore \ 5 unrecognised IRQ 2720 EQUW ignore \ 6 BRK - of no use to us 2730 EQUW ignore \ 6 unrecognised OSBYTE - of no use to us 2740 EQUW ignore \ 8 unrecognised OSWORD 2750 EQUW ignore \ *HELP command 2760 EQUW dospaceclaim \ &A fixed workspace is being claimed 2770.swtab1 2780\ 2790\ 2800\ 2930] 2940RETURN 3000REM SAVE"$.bbc-unix.RomHdr" >*spool