\ Disassembly of Opus EDOS 0.4 patched by EDOSPAT 4.51 (U) \ Greg Cook, 7/Mar/2008 \ Created with Watford DIS-ASM 1.20 \ Notes all done except Tube host code \ for which a commentary by J.G.Harston can be found at: \ http://mdfs.net/Software/Tube/BBC/Host.lst \ Comments beginning with capital letters are entry points \Paged ROM header 8000 4C B5 80 JMP &80B5 L.. \Language entry (RTS) 8003 4C 3D 80 JMP &803D L=. \Service entry 8006 82 ??? . \rom type: service only 8007 26 55 ROL &55 &U \copyright pointer 8009 4F ??? O \version byte and title 800A 50 55 BVC &8061 PU 800C 53 ??? S 800D 20 45 44 JSR &4445 ED 8010 4F ??? O 8011 53 ??? S 8012 20 00 30 JSR &3000 .0 \version string 8015 2E 34 30 ROL &3034 .40 8018 20 28 32 JSR &3228 (2 801B 35 20 AND &20,X 5 801D 46 65 LSR &65 Fe 801F 62 ??? b 8020 20 32 30 JSR &3032 20 8023 30 38 BMI &805D 08 8025 29 00 AND #&00 00000000 \copyright string 8027 28 PLP ( \(C) validated by MOS prior 8028 43 ??? C \to accepting ROM 8029 29 31 AND #&31 00110001 802B 39 38 34 AND &3438,Y 984 802E 20 41 6C JSR &6C41 Al 8031 61 6E ADC (&6E,X) an 8033 20 57 69 JSR &6957 Wi 8036 6C 6C 69 JMP (&696C) lli 8039 61 6D ADC (&6D,X) am 803B 73 ??? s 803C 00 BRK . \Paged ROM service 803D 20 03 B7 JSR &B703 .. \ROM service. call monitor 8040 C9 01 CMP #&01 00000001 \request absolute workspace 8042 F0 29 BEQ &806D .) 8044 C9 02 CMP #&02 00000010 \request private workspace 8046 F0 2C BEQ &8074 ., 8048 C9 03 CMP #&03 00000011 \boot 804A F0 45 BEQ &8091 .E 804C C9 04 CMP #&04 00000100 \unrecognised OSCLI 804E F0 47 BEQ &8097 .G 8050 C9 08 CMP #&08 00001000 \unrecognised OSWORD 8052 F0 49 BEQ &809D .I 8054 C9 09 CMP #&09 00001001 \*HELP 8056 F0 4B BEQ &80A3 .K 8058 C9 0A CMP #&0A 00001010 \claim absolute workspace 805A F0 4D BEQ &80A9 .M 805C C9 0F CMP #&0F 00001111 \vectors claimed 805E F0 49 BEQ &80A9 .I 8060 C9 12 CMP #&12 00010010 \initialise filing system 8062 F0 48 BEQ &80AC .H 8064 C9 FE CMP #&FE 11111110 \tube post initialisation 8066 F0 4E BEQ &80B6 .N 8068 C9 FF CMP #&FF 11111111 \tube main initialisation 806A F0 54 BEQ &80C0 .T 806C 60 RTS ` 806D C0 16 CPY #&16 00010110 \Request absolute workspace 806F B0 02 BCS &8073 .. \we need 8 pages 0E..15 incl. 8071 A0 16 LDY #&16 00010110 8073 60 RTS ` 8074 48 PHA H \Request private workspace 8075 98 TYA . \save our page number in the 8076 9D F0 0D STA &0DF0,X ... \OS ROM table 8079 85 A9 STA &A9 .. \and in high byte of pointer 807B 18 CLC . \claim one page 807C 69 01 ADC #&01 00000001 807E A8 TAY . 807F 68 PLA h \restore ROM call number 8080 20 00 92 JSR &9200 .. \save AXY 8083 AD 8D 02 LDA &028D ... \get last reset type 8086 F0 08 BEQ &8090 .. \if not 0 soft break 8088 A0 00 LDY #&00 00000000 \then low byte of pointer =0 808A 84 A8 STY &A8 .. \clear workspace flag in 808C A0 0D LDY #&0D 00001101 \byte &D of private page 808E 91 A8 STA (&A8),Y .. \marking it uninitialised. 8090 60 RTS ` 8091 20 C6 80 JSR &80C6 .. \Boot. test boot key 8094 B0 1A BCS &80B0 .. \if okay boot the disc 8096 60 RTS ` 8097 20 03 81 JSR &8103 .. \Unrecognised OSCLI. scan it 809A B0 17 BCS &80B3 .. \if we ran it break out 809C 60 RTS ` 809D 20 00 BA JSR &BA00 .. \Unrecognised OSWORD. compare 80A0 B0 11 BCS &80B3 .. \with our codes && break out 80A2 60 RTS ` 80A3 20 06 81 JSR &8106 .. \*HELP. search our topics 80A6 B0 0B BCS &80B3 .. \if specific to us break out 80A8 60 RTS ` 80A9 4C 06 96 JMP &9606 L.. \Wksp claim/vectors changed. 80AC C0 04 CPY #&04 00000100 \Initialise FS. our FS ID = 4 80AE D0 05 BNE &80B5 .. 80B0 20 03 96 JSR &9603 .. 80B3 A9 00 LDA #&00 00000000 \Break out of ROM call chain. 80B5 60 RTS ` 80B6 C0 00 CPY #&00 00000000 \Post-initialise Tube. 80B8 F0 FB BEQ &80B5 .. \edos ignores if Y=0 80BA 20 03 A0 JSR &A003 .. \otherwise it does post-init 80BD A9 00 LDA #&00 00000000 \and consumes the call. 80BF 60 RTS ` 80C0 20 00 A0 JSR &A000 .. \Initialise Tube. 80C3 A9 00 LDA #&00 00000000 \edos consumes this call 80C5 60 RTS ` 80C6 20 00 92 JSR &9200 .. \Test boot key 80C9 A9 7A LDA #&7A 01111010 \scan keyboard from code &10 80CB 20 F4 FF JSR &FFF4 .. 80CE 8A TXA . 80CF 30 09 BMI &80DA 0. \if no keypress C=1, allow boot 80D1 C9 32 CMP #&32 00110010 \if key is not "D" disallow boot 80D3 D0 07 BNE &80DC .. 80D5 A9 78 LDA #&78 01111000 \else register keypress for 2KR 80D7 20 F4 FF JSR &FFF4 .. 80DA 38 SEC 8 \return C=1 allow boot 80DB 60 RTS ` 80DC 18 CLC . \return C=0 disallow boot 80DD 60 RTS ` \Keyword recognition and help subsystem 8100 4C 0C 81 JMP &810C L.. \OSFSC 3 8103 4C 1A 81 JMP &811A L.. \OSCLI 8106 4C 13 81 JMP &8113 L.. \*HELP 8109 4C 70 81 JMP &8170 Lp. \Print syntax for command 810C 20 00 92 JSR &9200 .. \OSFSC 3. scan DFS commands 810F A2 2C LDX #&2C 00101100 8111 D0 0C BNE &811F .. 8113 20 00 92 JSR &9200 .. \*HELP. scans help keywords 8116 A2 E0 LDX #&E0 11100000 8118 D0 05 BNE &811F .. 811A 20 00 92 JSR &9200 .. \OSCLI. scans UTILS commands 811D A2 00 LDX #&00 00000000 811F 20 C2 FF JSR &FFC2 .. \Scan. call GSINIT on keyword 8122 8A TXA . \x=table offset. save X 8123 48 PHA H 8124 98 TYA . \save GSINIT offset in Y 8125 48 PHA H 8126 BD 1B 82 LDA &821B,X ... \get character from table 8129 F0 41 BEQ &816C .A \if NUL then exit C=0 812B 30 1F BMI &814C 0. \if terminator test completeness 812D 51 F2 EOR (&F2),Y Q. \else compare with command char 812F 29 DF AND #&DF 11011111 \make test case insensitive 8131 D0 04 BNE &8137 .. \if unequal test if abbreviated 8133 E8 INX . \else increment table offset 8134 C8 INY . \increment command offset 8135 D0 EF BNE &8126 .. \and loop. 8137 E8 INX . \search tbl for next terminator 8138 BD 1B 82 LDA &821B,X ... 813B 10 FA BPL &8137 .. 813D B1 F2 LDA (&F2),Y .. \get char where search stopped 813F C8 INY . \increment command offset 8140 C9 2E CMP #&2E 00101110 \was it a dot? 8142 F0 14 BEQ &8158 .. \if so accept the abbreviation 8144 68 PLA h \else restore command offset 8145 A8 TAY . \to start 8146 68 PLA h \discard old table offset 8147 E8 INX . \increment table offset by 3 to 8148 E8 INX . \skip syntax and action address 8149 E8 INX . 814A D0 D6 BNE &8122 .. \and compare with next keyword. 814C B1 F2 LDA (&F2),Y .. \get character after command 814E 29 DF AND #&DF 11011111 \convert to uppercase 8150 C9 41 CMP #&41 01000001 \is it less than "A"? 8152 90 04 BCC &8158 .. \then accept the command 8154 C9 5B CMP #&5B 01011011 \is it less than "Z"? 8156 90 EC BCC &8144 .. \then table entry was too short! 8158 BD 1C 82 LDA &821C,X ... \else accept command. 815B 85 A8 STA &A8 .. \get action address 815D BD 1D 82 LDA &821D,X ... \store in temp pointer 8160 85 A9 STA &A9 .. 8162 18 CLC . 8163 20 C2 FF JSR &FFC2 .. \call GSINIT on command tail 8166 68 PLA h \discard old GSINIT offset 8167 68 PLA h \get tbl offset of this command 8168 AA TAX . \place in X 8169 6C A8 00 JMP (&00A8) l.. \and jump to the action address. 816C 68 PLA h \command not found. 816D 68 PLA h \discard offsets 816E 18 CLC . \offer command to lower ROMs 816F 60 RTS ` \exit 8170 20 18 90 JSR &9018 .. \Print syntax for command 8173 08 PHP . \X=offset to help entry 8174 DC ??? . \error 220, "Syntax" 8175 53 ??? S 8176 79 6E 74 ADC &746E,Y ynt 8179 61 78 ADC (&78,X) ax 817B 3A ??? : 817C 00 BRK . 817D 20 F1 81 JSR &81F1 .. \print help entry 8180 20 09 90 JSR &9009 .. \display error (never returns) 8183 A9 02 LDA #&02 00000010 \*HELP 8185 A2 E3 LDX #&E3 11100011 \one column.point to keywd table 8187 20 94 81 JSR &8194 .. \print help keywords 818A 18 CLC . \pass call to lower ROMs 818B 60 RTS ` \exit 818C A2 2C LDX #&2C 00101100 \*HELP DFS 818E D0 02 BNE &8192 .. \point to DFS table 8190 A2 00 LDX #&00 00000000 \*HELP UTILS 8192 A9 01 LDA #&01 00000001 \Print help table, two columns: 8194 85 AA STA &AA .. \Print help table. 8196 20 C8 83 JSR &83C8 .. \print newline then EDOS banner 8199 20 F1 81 JSR &81F1 .. \print help entry 819C E8 INX . \skip syntax and action address 819D E8 INX . 819E E8 INX . 819F BD 18 82 LDA &8218,X ... \search keyword just printed 81A2 10 FA BPL &819E .. \until terminator found 81A4 BD 1B 82 LDA &821B,X ... \test first char of next keyword 81A7 F0 16 BEQ &81BF .. \if NUL print newline and exit 81A9 A5 AA LDA &AA .. \else toggle b0 of column flag 81AB 49 01 EOR #&01 00000001 81AD 85 AA STA &AA .. 81AF F0 06 BEQ &81B7 .. \if any bit is set 81B1 20 09 90 JSR &9009 .. \print newline 81B4 4C 99 81 JMP &8199 L.. \and loop 81B7 A9 28 LDA #&28 00101000 \else tab to column 40 81B9 20 06 90 JSR &9006 .. 81BC 4C 99 81 JMP &8199 L.. \and loop. 81BF 20 09 90 JSR &9009 .. \print newline 81C2 38 SEC 8 \break out of ROM call 81C3 60 RTS ` \exit 81C4 20 C8 83 JSR &83C8 .. \*HELP EDOS 81C7 20 18 90 JSR &9018 .. \print newline then EDOS banner 81CA 02 ??? . \EDOSPAT version number 81CB 45 44 EOR &44 ED \target controller 81CD 4F ??? O \and EDOSPAT author 81CE 53 ??? S 81CF 50 41 BVC &8214 PA 81D1 54 ??? T 81D2 20 34 2E JSR &2E34 4. 81D5 35 31 AND &31,X 51 81D7 20 28 55 JSR &5528 (U 81DA 29 20 AND #&20 00100000 81DC 4F ??? O 81DD 70 75 BVS &8256 pu 81DF 73 ??? s 81E0 20 32 37 JSR &3732 27 81E3 39 31 20 AND &2031,Y 91 81E6 20 3A 47 JSR &473A :G 81E9 2E 43 6F ROL &6F43 .Co 81EC 6F ??? o 81ED 6B ??? k 81EE 00 BRK . 81EF 38 SEC 8 81F0 60 RTS ` 81F1 20 00 92 JSR &9200 .. \Print help entry, X=offset. 81F4 A9 02 LDA #&02 00000010 \tab to column 2 or more 81F6 20 06 90 JSR &9006 .. \returning current POS in A 81F9 48 PHA H \save POS 81FA BD 1B 82 LDA &821B,X ... \get character from table 81FD 30 06 BMI &8205 0. \if not the terminator 81FF 20 00 90 JSR &9000 .. \print the character 8202 E8 INX . \advance offset 8203 D0 F5 BNE &81FA .. \and loop 8205 29 7F AND #&7F 01111111 \else mask terminator 8207 AA TAX . \to get offset of syntax 8208 68 PLA h \get back POS 8209 18 CLC . \add 9 820A 69 09 ADC #&09 00001001 820C 20 06 90 JSR &9006 .. \tab to 9 places after command 820F BD 14 83 LDA &8314,X ... \get character from syntax 8212 F0 06 BEQ &821A .. \if NUL then exit 8214 20 00 90 JSR &9000 .. \else print the character 8217 E8 INX . \advance offset 8218 D0 F5 BNE &820F .. \and loop. 821A 60 RTS ` 821B 42 ??? B \Table of UTILS commands 821C 55 49 EOR &49,X UI \*BUILD. Command name 821E 4C 44 BA JMP &BA44 LD. \Syntax fsp (b7 set) 8221 00 BRK . \Action address &8400 8222 84 44 STY &44 .D \*DISC I, &8403 8224 49 53 EOR #&53 01010011 8226 43 ??? C 8227 B8 CLV . 8228 03 ??? . 8229 84 44 STY &44 .D \*DISK I, &8403 822B 49 53 EOR #&53 01010011 822D 4B ??? K 822E B8 CLV . 822F 03 ??? . 8230 84 44 STY &44 .D \*DUMP fsp, &8406 8232 55 4D EOR &4D,X UM 8234 50 BA BVC &81F0 P. 8236 06 84 ASL &84 .. 8238 4C 49 53 JMP &5349 LIS \*LIST fsp, &8409 823B 54 ??? T 823C BA TSX . 823D 09 84 ORA #&84 10000100 823F 54 ??? T \*TYPE fsp, &840C 8240 59 50 45 EOR &4550,Y YPE 8243 BA TSX . 8244 0C ??? . 8245 84 00 STY &00 .. 8247 41 43 EOR (&43,X) AC \Table of DFS commands 8249 43 ??? C \*ACCESS fsp L, &8600 824A 45 53 EOR &53 ES 824C 53 ??? S 824D 80 ??? . 824E 00 BRK . 824F 86 42 STX &42 .B \*BACKUP drv drv, &8A00 8251 41 43 EOR (&43,X) AC 8253 4B ??? K 8254 55 50 EOR &50,X UP 8256 88 DEY . 8257 00 BRK . 8258 8A TXA . 8259 43 ??? C \*CATGEN vol ..., &A903 825A 41 54 EOR (&54,X) AT 825C 47 ??? G 825D 45 4E EOR &4E EN 825F E1 03 SBC (&03,X) .. 8261 A9 43 LDA #&43 01000011 \*COMPACT vol, &8A03 8263 4F ??? O 8264 4D 50 41 EOR &4150 MPA 8267 43 ??? C 8268 54 ??? T 8269 9B ??? . 826A 03 ??? . 826B 8A TXA . 826C 43 ??? C \*COPY vol vol afsp, &8A06 826D 4F ??? O 826E 50 59 BVC &82C9 PY 8270 9F ??? . 8271 06 8A ASL &8A .. 8273 44 ??? D \*DELETE fsp, &8606 8274 45 4C EOR &4C EL 8276 45 54 EOR &54 ET 8278 45 BA EOR &BA E. 827A 06 86 ASL &86 .. 827C 44 ??? D \*DESTROY afsp, &8609 827D 45 53 EOR &53 ES 827F 54 ??? T 8280 52 ??? R 8281 4F ??? O 8282 59 B3 09 EOR &09B3,Y Y.. 8285 86 44 STX &44 .D \*DIR dir, &860C 8287 49 52 EOR #&52 01010010 8289 BE 0C 86 LDX &860C,Y ... 828C 44 ??? D \*DRIVE vol, &8627 828D 52 ??? R 828E 49 56 EOR #&56 01010110 8290 45 9B EOR &9B E. 8292 27 ??? ' 8293 86 45 STX &45 .E \*ENABLE, &8A09 8295 4E 41 42 LSR &4241 NAB 8298 4C 45 B7 JMP &B745 LE. 829B 09 8A ORA #&8A 10001010 829D 46 43 LSR &43 FC \*FCOPY fsp name, &8A12 829F 4F ??? O 82A0 50 59 BVC &82FB PY 82A2 C2 ??? . 82A3 12 ??? . 82A4 8A TXA . 82A5 46 4F LSR &4F FO \*FORMAT drv ..., &A900 82A7 52 ??? R 82A8 4D 41 54 EOR &5441 MAT 82AB F5 00 SBC &00,X .. 82AD A9 49 LDA #&49 01001001 \*INFO afsp, &8612 82AF 4E 46 4F LSR &4F46 NFO 82B2 B3 ??? . 82B3 12 ??? . 82B4 86 4C STX &4C .L \*LIB dir, &8615 82B6 49 42 EOR #&42 01000010 82B8 BE 15 86 LDX &8615,Y ... 82BB 4C 4F 43 JMP &434F LOC \*LOCK afsp, &8621 82BE 4B ??? K 82BF B3 ??? . 82C0 21 86 AND (&86,X) !. 82C2 52 ??? R \*RENAME fsp name, &8618 82C3 45 4E EOR &4E EN 82C5 41 4D EOR (&4D,X) AM 82C7 45 C2 EOR &C2 E. 82C9 18 CLC . 82CA 86 53 STX &53 .S \*SCOPY vol vol afsp, &8A0F 82CC 43 ??? C 82CD 4F ??? O 82CE 50 59 BVC &8329 PY 82D0 9F ??? . 82D1 0F ??? . 82D2 8A TXA . 82D3 54 ??? T \*TITLE title, &861B 82D4 49 54 EOR #&54 01010100 82D6 4C 45 DB JMP &DB45 LE. 82D9 1B ??? . 82DA 86 55 STX &55 .U \*UNLOCK afsp, &8624 82DC 4E 4C 4F LSR &4F4C NLO 82DF 43 ??? C 82E0 4B ??? K 82E1 B3 ??? . 82E2 24 86 BIT &86 $. 82E4 56 45 LSR &45,X VE \*VERIFY drv, &A906 82E6 52 ??? R 82E7 49 46 EOR #&46 01000110 82E9 59 F1 06 EOR &06F1,Y Y.. 82EC A9 56 LDA #&56 01010110 \*VOL vol, &8627 82EE 4F ??? O 82EF 4C 9B 27 JMP &279B L.' 82F2 86 57 STX &57 .W \*WIPE afsp, &861E 82F4 49 50 EOR #&50 01010000 82F6 45 B3 EOR &B3 E. 82F8 1E 86 00 ASL &0086,X ... \Help keywords 82FB B7 ??? . \*HELP, &83DA 82FC DA ??? . 82FD 83 ??? . 82FE 45 44 EOR &44 ED \*HELP EDOS, &81C4 8300 4F ??? O 8301 53 ??? S 8302 B7 ??? . 8303 C4 81 CPY &81 .. 8305 44 ??? D \*HELP DFS, &818C 8306 46 53 LSR &53 FS 8308 B7 ??? . 8309 8C 81 55 STY &5581 ..U \*HELP UTILS, &8190 830C 54 ??? T 830D 49 4C EOR #&4C 01001100 830F 53 ??? S 8310 B7 ??? . 8311 90 81 BCC &8294 .. 8313 00 BRK . 8314 61 66 ADC (&66,X) af \Syntax particles 8316 73 ??? s \afsp L 8317 70 20 BVS &8339 p 8319 20 4C 00 JSR &004C L. 831C 73 ??? s \src drv dest drv 831D 72 ??? r 831E 63 ??? c 831F 20 64 72 JSR &7264 dr 8322 76 20 ROR &20,X v 8324 20 20 64 JSR &6420 d 8327 65 73 ADC &73 es 8329 74 ??? t 832A 20 64 72 JSR &7264 dr 832D 76 00 ROR &00,X v. 832F 76 6F ROR &6F,X vo \vol 8331 6C 00 73 JMP (&7300) l.s \src vol dest vol afsp 8334 72 ??? r 8335 63 ??? c 8336 20 76 6F JSR &6F76 vo 8339 6C 20 20 JMP (&2020) l 833C 20 64 65 JSR &6564 de 833F 73 ??? s 8340 74 ??? t 8341 20 76 6F JSR &6F76 vo 8344 6C 20 20 JMP (&2020) l 8347 61 66 ADC (&66,X) af 8349 73 ??? s 834A 70 00 BVS &834C p. \(empty syntax) 834C 49 00 EOR #&00 00000000 \I 834E 66 73 ROR &73 fs \fsp 8350 70 00 BVS &8352 p. 8352 64 ??? d \dir 8353 69 72 ADC #&72 01110010 8355 00 BRK . 8356 6F ??? o \old fsp new entry name 8357 6C 64 20 JMP (&2064) ld 835A 66 73 ROR &73 fs 835C 70 20 BVS &837E p 835E 20 20 6E JSR &6E20 n 8361 65 77 ADC &77 ew 8363 20 65 6E JSR &6E65 en 8366 74 ??? t 8367 72 ??? r 8368 79 20 6E ADC &6E20,Y y n 836B 61 6D ADC (&6D,X) am 836D 65 00 ADC &00 e. 836F 74 ??? t \title 8370 69 74 ADC #&74 01110100 8372 6C 65 00 JMP (&0065) le. 8375 64 ??? d \drv vol specs 8376 72 ??? r 8377 76 20 ROR &20,X v 8379 20 20 76 JSR &7620 v 837C 6F ??? o 837D 6C 20 73 JMP (&7320) l s 8380 70 65 BVS &83E7 pe 8382 63 ??? c 8383 73 ??? s 8384 00 BRK . 8385 64 ??? d \drv 8386 72 ??? r 8387 76 00 ROR &00,X v. 8389 64 ??? d \drv S D 40 80 40-80 Oo 838A 72 ??? r 838B 76 20 ROR &20,X v 838D 20 53 20 JSR &2053 S 8390 20 44 20 JSR &2044 D 8393 20 34 30 JSR &3034 40 8396 20 20 38 JSR &3820 8 8399 30 20 BMI &83BB 0 839B 20 34 30 JSR &3034 40 839E 2D 38 30 AND &3038 -80 83A1 20 20 4F JSR &4F20 O 83A4 6F ??? o 83A5 00 BRK . \EDOSPAT extensions, block 1 83C8 20 09 90 JSR &9009 .. \Print newline then EDOS banner 83CB 4C 00 96 JMP &9600 L.. 83CE 20 00 96 JSR &9600 .. \Print EDOS banner then newline 83D1 4C 09 90 JMP &9009 L.. 83D4 B9 00 01 LDA &0100,Y ... \Get character from *DUMP row 83D7 C9 7F CMP #&7F 01111111 \exit C=1 if DEL or higher. 83D9 60 RTS ` 83DA 18 CLC . \*HELP with empty keyword: 83DB 20 C2 FF JSR &FFC2 .. \call GSINIT on current position 83DE F0 0F BEQ &83EF .. \if end-of-string then scan kywd 83E0 C9 2E CMP #&2E 00101110 \else test if first char is dot 83E2 D0 09 BNE &83ED .. \if not then ignore call, else: 83E4 20 C4 81 JSR &81C4 .. \*HELP . 83E7 20 8C 81 JSR &818C .. \do *HELP EDOS, *HELP DFS 83EA 20 90 81 JSR &8190 .. \do *HELP UTILS 83ED 18 CLC . \and pass *HELP . to lower ROMs. 83EE 60 RTS ` 83EF 98 TYA . \scan for end of keyword: 83F0 F0 0B BEQ &83FD .. \if start-of-string then *HELP 83F2 88 DEY . \else step back one character 83F3 B1 F2 LDA (&F2),Y .. \fetch it 83F5 C9 20 CMP #&20 00100000 \if space then keep scanning 83F7 F0 F6 BEQ &83EF .. 83F9 C9 22 CMP #&22 00100010 \if double quotes 83FB F0 F0 BEQ &83ED .. \then ignore the call 83FD 4C 83 81 JMP &8183 L.. \if anything else then *HELP \Utilities 8400 4C 0F 84 JMP &840F L.. \*BUILD 8403 4C 71 84 JMP &8471 Lq. \*DISC, *DISK 8406 4C 82 84 JMP &8482 L.. \*DUMP 8409 4C F4 84 JMP &84F4 L.. \*LIST 840C 4C 1F 85 JMP &851F L.. \*TYPE 840F A9 80 LDA #&80 10000000 \*BUILD 8411 20 3B 85 JSR &853B ;. \open file for writing 8414 20 67 84 JSR &8467 g. \flush all open files 8417 20 73 85 JSR &8573 s. \increment line number 841A 20 8B 85 JSR &858B .. \print line number 841D 20 44 84 JSR &8444 D. \input line 8420 A6 AA LDX &AA .. \get low byte of pointer 8422 E4 AF CPX &AF .. \compare with line length 8424 F0 0B BEQ &8431 .. \if equal input next line 8426 A2 00 LDX #&00 00000000 \else get char at pointer 8428 A1 AA LDA (&AA,X) .. 842A 20 D4 FF JSR &FFD4 .. \call OSBPUT 842D E6 AA INC &AA .. \advance pointer 842F D0 EF BNE &8420 .. \loop until end of buffer 8431 24 FF BIT &FF $. \test escape flag 8433 10 E2 BPL &8417 .. \if clear input next line 8435 98 TYA . \else save file handle 8436 48 PHA H 8437 A9 7E LDA #&7E 01111110 \acknowledge Escape 8439 20 F4 FF JSR &FFF4 .. 843C 68 PLA h \restore file handle 843D A8 TAY . 843E 20 E7 FF JSR &FFE7 .. \print newline 8441 4C 6C 85 JMP &856C Ll. \close file and exit. 8444 20 00 92 JSR &9200 .. \Input line 8447 88 DEY . \Y=handle, point to previous 8448 C0 11 CPY #&11 00010001 \buffer. If buffer was &11 844A B0 02 BCS &844E .. \or less, point to next 844C C8 INY . \buffer. 844D C8 INY . 844E 84 AB STY &AB .. \store high byte of pointer 8450 A0 FF LDY #&FF 11111111 8452 84 AC STY &AC .. \maximum line length = 255 8454 84 AE STY &AE .. \maximum ASCII value = 255 8456 C8 INY . \set Y=0 8457 84 AA STY &AA .. \clear low byte of pointer 8459 84 AD STY &AD .. \minimum ASCII value = 0 845B 98 TYA . \set A=0 845C A2 AA LDX #&AA 10101010 \point XY to parameter block 845E 20 F1 FF JSR &FFF1 .. \call OSWORD to input line 8461 B0 01 BCS &8464 .. \if user did not Escape 8463 C8 INY . \add 1 for the CR character 8464 84 AF STY &AF .. \return length of line in &AF 8466 60 RTS ` 8467 20 00 92 JSR &9200 .. \Flush all open files 846A A9 FF LDA #&FF 11111111 846C A0 00 LDY #&00 00000000 846E 4C DA FF JMP &FFDA L.. 8471 20 C5 FF JSR &FFC5 .. \*DISC, *DISK 8474 A0 01 LDY #&01 00000001 \call GSREAD for next char 8476 B0 05 BCS &847D .. \if EOS init EDOS, Y=1 no boot 8478 C9 49 CMP #&49 01001001 \else is character "I"? 847A D0 01 BNE &847D .. \if not init EDOS, Y=1 no boot 847C 88 DEY . \else Y=0 to boot default drive 847D 20 03 96 JSR &9603 .. \initialise EDOS 8480 38 SEC 8 \C=1, exit and break ROM call 8481 60 RTS ` 8482 20 39 85 JSR &8539 9. \*DUMP 8485 AE 55 03 LDX &0355 .U. \open file, get current MODE 8488 BD EC 84 LDA &84EC,X ... \get ASCII column tab for MODE 848B 85 AA STA &AA .. \store in temp 848D BD E4 84 LDA &84E4,X ... \get bytes per row for MODE 8490 85 AF STA &AF .. \store in temp 8492 20 93 85 JSR &8593 .. \BGET byte 8495 B0 27 BCS &84BE .' \if EOF close file 8497 20 8A 85 JSR &858A .. \else print file offset+space 849A 20 79 85 JSR &8579 y. \add bytes/row to file offset 849D A6 AF LDX &AF .. \X=bytes per row 849F 24 AA BIT &AA $. \if b7 of tab clear 84A1 30 03 BMI &84A6 0. 84A3 20 03 90 JSR &9003 .. \then print space. 84A6 38 SEC 8 \permit leading zero 84A7 20 0F 90 JSR &900F .. \print hex byte 84AA 9D 00 01 STA &0100,X ... \store byte for ASCII column 84AD CA DEX . \decrement column counter 84AE D0 06 BNE &84B6 .. \if no more columns 84B0 20 C1 84 JSR &84C1 .. \print ASCII column 84B3 4C 92 84 JMP &8492 L.. \and loop for next row. 84B6 20 93 85 JSR &8593 .. \else BGET next byte 84B9 90 E4 BCC &849F .. \if no EOF print it and loop 84BB 20 C1 84 JSR &84C1 .. \else flush ASCII column 84BE 4C 6C 85 JMP &856C Ll. \close file and exit. 84C1 20 00 92 JSR &9200 .. \Print ASCII column 84C4 A5 AA LDA &AA .. \X=no.chars not to print 84C6 29 7F AND #&7F 01111111 \mask print-space bit off tab 84C8 20 06 90 JSR &9006 .. \tab to screen column 84CB A4 AF LDY &AF .. \Y=bytes per row 84CD 20 D4 83 JSR &83D4 .. \get byte from stack page 84D0 B0 04 BCS &84D6 .. \if >=&7F print a dot 84D2 C9 20 CMP #&20 00100000 \else if >=&20 print character 84D4 B0 02 BCS &84D8 .. 84D6 A9 2E LDA #&2E 00101110 \else print a dot 84D8 20 00 90 JSR &9000 .. 84DB 88 DEY . \decrement byte pointer 84DC E8 INX . \increment bytes not to print 84DD E4 AF CPX &AF .. \if result <> bytes per column 84DF D0 EC BNE &84CD .. \then loop for next character 84E1 4C E7 FF JMP &FFE7 L.. \else print newline and exit. 84E4 10 08 BPL &84EE .. \*DUMP bytes/row in MODEs [0..7] 84E6 04 ??? . 84E7 10 08 BPL &84F1 .. 84E9 04 ??? . 84EA 08 PHP . 84EB 08 PHP . 84EC 37 ??? 7 \*DUMP ASCII tab in MODEs [0..7] 84ED 1F ??? . 84EE 8E 37 1F STX &1F37 .7. 84F1 8E 1F 1F STX &1F1F ... 84F4 20 39 85 JSR &8539 9. \*LIST 84F7 20 93 85 JSR &8593 .. \open file, BGET char 84FA B0 70 BCS &856C .p \if EOF close file 84FC 20 73 85 JSR &8573 s. \else increment line number 84FF 20 8B 85 JSR &858B .. \print line number 8502 20 E3 FF JSR &FFE3 .. \call OSASCI to print char 8505 C9 0D CMP #&0D 00001101 \was it CR? 8507 F0 EE BEQ &84F7 .. \if so start next line 8509 C9 0A CMP #&0A 00001010 \was it LF? 850B F0 07 BEQ &8514 .. \if so BGET+OSWRCH next char 850D 20 93 85 JSR &8593 .. \else BGET next character 8510 B0 5A BCS &856C .Z \if EOF close file 8512 90 EE BCC &8502 .. \else print char and loop. 8514 20 93 85 JSR &8593 .. \test Escape and BGET char 8517 B0 53 BCS &856C .S \if EOF close file 8519 20 EE FF JSR &FFEE .. \else call OSWRCH to print 851C 4C 05 85 JMP &8505 L.. \interpret char and loop. 851F 20 39 85 JSR &8539 9. \*TYPE 8522 20 93 85 JSR &8593 .. \open file, BGET char 8525 B0 45 BCS &856C .E \if EOF close file 8527 20 E3 FF JSR &FFE3 .. \else print char with OSASCI 852A C9 0A CMP #&0A 00001010 \was it LF? 852C D0 F4 BNE &8522 .. \if not loop for next char 852E 20 93 85 JSR &8593 .. \else BGET next char 8531 B0 39 BCS &856C .9 \if EOF close file 8533 20 EE FF JSR &FFEE .. \else call OSWRCH to print 8536 4C 2A 85 JMP &852A L*. \interpret char and loop. 8539 A9 40 LDA #&40 01000000 \Open file for reading 853B 20 00 92 JSR &9200 .. \Open file 853E 48 PHA H \save A 853F 98 TYA . \GSREAD pointer (&F2),Y 8540 18 CLC . \points to filename. 8541 65 F2 ADC &F2 e. \calculate XY = &F2,3 + Y 8543 AA TAX . \X = Y + &F2 8544 A9 00 LDA #&00 00000000 \A = 0 8546 85 A8 STA &A8 .. \as side effect line no.=0 8548 85 A9 STA &A9 .. \Y = 0 + &F3 + carry 854A 65 F3 ADC &F3 e. 854C A8 TAY . 854D 68 PLA h \restore A file open mode 854E 20 CE FF JSR &FFCE .. \call OSFIND to open file 8551 BA TSX . \return handle in Y 8552 9D 03 01 STA &0103,X ... 8555 AA TAX . \if handle = 0 8556 D0 1A BNE &8572 .. 8558 20 18 90 JSR &9018 .. \give "File not found" error. 855B 0A ASL A . 855C D6 46 DEC &46,X .F 855E 69 6C ADC #&6C 01101100 8560 65 20 ADC &20 e 8562 6E 6F 74 ROR &746F not 8565 20 66 6F JSR &6F66 fo 8568 75 6E ADC &6E,X un 856A 64 ??? d 856B 00 BRK . 856C A9 00 LDA #&00 00000000 \Close file 856E 20 CE FF JSR &FFCE .. \break unrecognised OSCLI 8571 38 SEC 8 \ROM call and exit 8572 60 RTS ` 8573 48 PHA H \Increment line number 8574 F8 SED . 8575 A9 01 LDA #&01 00000001 8577 D0 03 BNE &857C .. 8579 48 PHA H \Add bytes/row to file offset 857A A5 AF LDA &AF .. 857C 18 CLC . 857D 65 A8 ADC &A8 e. 857F 85 A8 STA &A8 .. 8581 A9 00 LDA #&00 00000000 8583 65 A9 ADC &A9 e. 8585 85 A9 STA &A9 .. 8587 D8 CLD . 8588 68 PLA h 8589 60 RTS ` 858A 38 SEC 8 \Print offset w/leading zeroes 858B 20 15 90 JSR &9015 .. \Print BCD line no at &00A8 858E A8 TAY . 858F 00 BRK . 8590 4C 03 90 JMP &9003 L.. \print space and exit 8593 24 FF BIT &FF $. \Test Escape and BGET 8595 30 DA BMI &8571 0. 8597 4C D7 FF JMP &FFD7 L.. \'Light' DFS commands 8600 4C 2A 86 JMP &862A L*. \*ACCESS 8603 4C 74 86 JMP &8674 Lt. \*CAT 8606 4C BC 87 JMP &87BC L.. \*DELETE 8609 4C CD 87 JMP &87CD L.. \*DESTROY 860C 4C 0E 88 JMP &880E L.. \*DIR 860F 4C 28 88 JMP &8828 L(. \Was *DRIVE 8612 4C 42 88 JMP &8842 LB. \*INFO 8615 4C 35 88 JMP &8835 L5. \*LIB 8618 4C 54 88 JMP &8854 LT. \*RENAME 861B 4C 91 88 JMP &8891 L.. \*TITLE 861E 4C B9 88 JMP &88B9 L.. \*WIPE 8621 4C 3E 86 JMP &863E L>. \*LOCK 8624 4C 4C 86 JMP &864C LL. \*UNLOCK 8627 4C 1B 88 JMP &881B L.. \*VOL, *DRIVE 862A 20 15 93 JSR &9315 .. \*ACCESS 862D 20 C5 FF JSR &FFC5 .. \get afsp, call GSREAD 8630 B0 1D BCS &864F .. \if end of string unlock file 8632 C9 4C CMP #&4C 01001100 \else is character "L"? 8634 D0 05 BNE &863B .. \if not print syntax and exit 8636 20 C5 FF JSR &FFC5 .. \call GSREAD for next char 8639 B0 06 BCS &8641 .. \if end of string lock file 863B 4C 09 81 JMP &8109 L.. \else print syntax and exit 863E 20 15 93 JSR &9315 .. \*LOCK 8641 20 6A 86 JSR &866A j. \select file, dir in A 8644 09 80 ORA #&80 10000000 \set attribute bit 8646 20 5A 86 JSR &865A Z. \update file, select next 8649 90 F9 BCC &8644 .. \loop until no more files 864B 60 RTS ` 864C 20 15 93 JSR &9315 .. \*UNLOCK 864F 20 6A 86 JSR &866A j. \select file, dir in A 8652 29 7F AND #&7F 01111111 \clear attribute bit 8654 20 5A 86 JSR &865A Z. \update file, select next 8657 90 F9 BCC &8652 .. \loop until no more files 8659 60 RTS ` 865A 8D 47 10 STA &1047 .G. \Update file entry 865D 20 06 A6 JSR &A606 .. \store dir, pack catalogue entry 8660 20 0F A5 JSR &A50F .. \find next match of afsp 8663 90 08 BCC &866D .. \if more matches select next 8665 20 03 9B JSR &9B03 .. \else write catalogue 8668 38 SEC 8 \set carry and exit 8669 60 RTS ` 866A 20 83 89 JSR &8983 .. \Select file from afsp 866D 20 03 A6 JSR &A603 .. \?, unpack catalogue entry 8670 AD 47 10 LDA &1047 .G. \return directory and attribute 8673 60 RTS ` 8674 20 06 93 JSR &9306 .. \*CAT 8677 20 0C 9B JSR &9B0C .. \get drv/vol spec, softmount 867A 20 6E 89 JSR &896E n. \reset column COUNT = 0 867D 20 18 90 JSR &9018 .. \print "Defs" 8680 00 BRK . 8681 44 ??? D 8682 65 66 ADC &66 ef 8684 73 ??? s 8685 00 BRK . 8686 A2 00 LDX #&00 00000000 \x=0 for default path 8688 20 E9 88 JSR &88E9 .. \print " :"+path 868B A9 2E LDA #&2E 00101110 \start with a dot 868D 20 00 90 JSR &9000 .. \print character in A 8690 BD 00 10 LDA &1000,X ... \get character of def filename 8693 E8 INX . \increment index 8694 E0 08 CPX #&08 00001000 \have we loaded 7 characters? 8696 D0 F5 BNE &868D .. \if not then loop 8698 20 73 89 JSR &8973 s. \else tab to next 20-column 869B 20 18 90 JSR &9018 .. \print "Lib" 869E 00 BRK . 869F 4C 69 62 JMP &6269 Lib 86A2 00 BRK . 86A3 A2 03 LDX #&03 00000011 \x=3 for library path 86A5 20 E9 88 JSR &88E9 .. \print " :"+path 86A8 20 73 89 JSR &8973 s. \tab to next 20-column 86AB A5 C9 LDA &C9 .. \get immediate (*CAT) drive 86AD 20 18 90 JSR &9018 .. \print "Drive "+number 86B0 C0 44 CPY #&44 01000100 86B2 72 ??? r 86B3 69 76 ADC #&76 01110110 86B5 65 20 ADC &20 e 86B7 00 BRK . 86B8 AA TAX . \drive number to X register 86B9 BD F8 0F LDA &0FF8,X ... \get track stepping status 86BC D0 09 BNE &86C7 .. \if enabled skip forward 86BE BD F4 0F LDA &0FF4,X ... \else get no. tracks 86C1 20 04 89 JSR &8904 .. \print "n tracks" 86C4 4C D3 86 JMP &86D3 L.. \skip forward. 86C7 20 18 90 JSR &9018 .. \print " 40-80" 86CA 00 BRK . 86CB 20 20 34 JSR &3420 4 86CE 30 2D BMI &86FD 0- 86D0 38 SEC 8 86D1 30 00 BMI &86D3 0. 86D3 20 73 89 JSR &8973 s. \tab to next 20-column 86D6 BD F0 0F LDA &0FF0,X ... \get density flag 86D9 4A LSR A J \divide by 8 (SD=1 DD=2) 86DA 4A LSR A J 86DB 4A LSR A J 86DC 20 18 90 JSR &9018 .. \print "Density "+number 86DF 80 ??? . 86E0 44 ??? D 86E1 65 6E ADC &6E en 86E3 73 ??? s 86E4 69 74 ADC #&74 01110100 86E6 79 20 00 ADC &0020,Y y . 86E9 BD FC 0F LDA &0FFC,X ... \get number of volumes 86EC F0 32 BEQ &8720 .2 \if DFS skip volume list 86EE 20 03 90 JSR &9003 .. \else print a space 86F1 A0 41 LDY #&41 01000001 \start with "A" 86F3 B9 EF 0F LDA &0FEF,Y ... \get no. tracks in 1030..7 86F6 F0 04 BEQ &86FC .. \if none volume not present 86F8 98 TYA . \else print volume letter 86F9 20 00 90 JSR &9000 .. 86FC C8 INY . \increment volume letter 86FD C0 49 CPY #&49 01001001 \is it before "I"? 86FF D0 F2 BNE &86F3 .. \if so loop. 8701 A4 C8 LDY &C8 .. \get immediate (*CAT) volume 8703 D0 18 BNE &871D .. \if undefined then 8705 20 6B 89 JSR &896B k. \cat all vols: print newline 8708 A0 41 LDY #&41 01000001 \set immediate volume = "A" 870A 84 C8 STY &C8 .. 870C B9 EF 0F LDA &0FEF,Y ... \get no. tracks in volume 870F F0 06 BEQ &8717 .. \if volume is present 8711 20 00 9B JSR &9B00 .. \then read volume catalogue 8714 20 23 87 JSR &8723 #. \and list its contents. 8717 C8 INY . \increment volume letter 8718 C0 49 CPY #&49 01001001 \if now less than "I" 871A D0 EE BNE &870A .. \then loop over volumes 871C 60 RTS ` \else exit. 871D 20 09 9B JSR &9B09 .. \load volume catalogue 8720 20 6B 89 JSR &896B k. \print newline, reset count 8723 20 00 92 JSR &9200 .. \save AXY 8726 20 6B 89 JSR &896B k. \print newline, reset count 8729 A2 00 LDX #&00 00000000 \print first 8 characters 872B BD 00 0E LDA &0E00,X ... \of title in sector 0 872E 20 00 90 JSR &9000 .. 8731 E8 INX . 8732 E0 08 CPX #&08 00001000 8734 D0 F5 BNE &872B .. 8736 A2 00 LDX #&00 00000000 \print last 4 characters 8738 BD 00 0F LDA &0F00,X ... \of title in sector 1 873B 20 00 90 JSR &9000 .. 873E E8 INX . 873F E0 04 CPX #&04 00000100 8741 D0 F5 BNE &8738 .. 8743 AD 04 0F LDA &0F04 ... \get cycle number 8746 20 18 90 JSR &9018 .. \print " ("+hex byte 8749 40 RTI @ 874A 20 28 00 JSR &0028 (. 874D A9 29 LDA #&29 00101001 \print ")" 874F 20 00 90 JSR &9000 .. 8752 A6 C9 LDX &C9 .. \x=*CAT drive number 8754 BD FC 0F LDA &0FFC,X ... \get number of volumes 8757 F0 18 BEQ &8771 .. \if not a DFS disc 8759 20 73 89 JSR &8973 s. \then tab to next 20-column 875C 20 73 89 JSR &8973 s. \and again 875F A4 C8 LDY &C8 .. \get *CAT volume letter 8761 98 TYA . 8762 20 18 90 JSR &9018 .. \print "Vol " +letter 8765 C0 56 CPY #&56 01010110 8767 6F ??? o 8768 6C 20 00 JMP (&0020) l . 876B B9 EF 0F LDA &0FEF,Y ... \get number of tracks in volume 876E 20 04 89 JSR &8904 .. \print "n tracks" 8771 20 73 89 JSR &8973 s. \tab to next 20-field 8774 20 1B A6 JSR &A61B .. \get free space on volume 8777 20 09 A4 JSR &A409 .. \print decimal word 877A 20 18 90 JSR &9018 .. \print "free/" 877D 00 BRK . 877E 66 72 ROR &72 fr 8780 65 65 ADC &65 ee 8782 2F ??? / 8783 00 BRK . 8784 AD 06 0F LDA &0F06 ... \get sectors on volume high 8787 29 07 AND #&07 00000111 \mask all but low 3 bits 8789 8D 61 10 STA &1061 .a. \store in accumulator high 878C AD 07 0F LDA &0F07 ... \get sectors on volume low 878F 8D 60 10 STA &1060 .`. \store accumulator low 8792 20 09 A4 JSR &A409 .. \print decimal word 8795 20 03 90 JSR &9003 .. \print space 8798 20 09 96 JSR &9609 .. \get boot option, X=offset 879B A9 20 LDA #&20 00100000 \start with a space 879D 20 00 90 JSR &9000 .. \print character in A 87A0 BD 0C 96 LDA &960C,X ... \get char of boot opt string 87A3 E8 INX . \increment X 87A4 C9 20 CMP #&20 00100000 \was the character space? 87A6 D0 F5 BNE &879D .. \if not then loop 87A8 20 6B 89 JSR &896B k. \else print newline 87AB AD 07 10 LDA &1007 ... \get default directory 87AE 85 C7 STA &C7 .. \store immediate directory 87B0 A9 00 LDA #&00 00000000 \set A=0 87B2 20 18 89 JSR &8918 .. \list files in immed dir 87B5 A9 80 LDA #&80 10000000 \set A=&80 87B7 20 18 89 JSR &8918 .. \list files in all (other) dirs 87BA 38 SEC 8 \breakout ROM call and exit 87BB 60 RTS ` 87BC 20 12 93 JSR &9312 .. \*DELETE 87BF 20 83 89 JSR &8983 .. \get fsp, cat &check f.exists 87C2 20 21 A5 JSR &A521 !. \check file not locked 87C5 20 00 A6 JSR &A600 .. \delete catalogue entry 87C8 20 03 9B JSR &9B03 .. \write catalogue 87CB 38 SEC 8 \breakout ROM call and exit. 87CC 60 RTS ` 87CD 20 15 93 JSR &9315 .. \*DESTROY 87D0 20 00 9B JSR &9B00 .. \get afsp, load catalogue 87D3 20 12 A5 JSR &A512 .. \find unlocked file in cat 87D6 B0 34 BCS &880C .4 \if not found exit silently 87D8 20 6E 89 JSR &896E n. \else reset column count 87DB 20 03 A6 JSR &A603 .. \unpack fields from catalogue 87DE 20 03 A4 JSR &A403 .. \print directory and filename 87E1 20 00 A6 JSR &A600 .. \delete catalogue entry 87E4 20 18 A5 JSR &A518 .. \find next unlocked match 87E7 B0 06 BCS &87EF .. \if found 87E9 20 73 89 JSR &8973 s. \then tab to next 20-column 87EC 4C DB 87 JMP &87DB L.. \and loop 87EF 20 18 90 JSR &9018 .. \else ask 87F2 11 44 ORA (&44),Y .D \"Destroy these files?" 87F4 65 73 ADC &73 es \(*ENABLE won't bypass it) 87F6 74 ??? t 87F7 72 ??? r 87F8 6F ??? o 87F9 79 20 74 ADC &7420,Y y t 87FC 68 PLA h 87FD 65 73 ADC &73 es 87FF 65 20 ADC &20 e 8801 66 69 ROR &69 fi 8803 6C 65 73 JMP (&7365) les 8806 00 BRK . 8807 D0 03 BNE &880C .. \if user answers yes 8809 20 03 9B JSR &9B03 .. \then write catalogue. 880C 38 SEC 8 \breakout ROM call and exit. 880D 60 RTS ` 880E 20 09 93 JSR &9309 .. \*DIR 8811 20 06 92 JSR &9206 .. \get path spec 8814 C7 ??? . \copy immediate path 8815 00 BRK . \to default path 8816 07 ??? . \(dir, volume and drive) 8817 10 03 BPL &881C .. 8819 38 SEC 8 \breakout ROM call and exit. 881A 60 RTS ` 881B 20 03 93 JSR &9303 .. \*VOL, *DRIVE 881E 20 06 92 JSR &9206 .. \get volume spec (no colon) 8821 C8 INY . \copy immediate vol+drive 8822 00 BRK . \to default path 8823 08 PHP . 8824 10 02 BPL &8828 .. 8826 38 SEC 8 \breakout ROM call and exit. 8827 60 RTS ` 8828 20 00 93 JSR &9300 .. \Was *DRIVE 882B 20 06 92 JSR &9206 .. \get drive number 882E C9 00 CMP #&00 00000000 \copy immediate drive 8830 09 10 ORA #&10 00010000 \to default path 8832 01 38 ORA (&38,X) .8 \breakout ROM call and exit. 8834 60 RTS ` 8835 20 09 93 JSR &9309 .. \*LIB 8838 20 06 92 JSR &9206 .. \get path spec 883B C7 ??? . \copy immediate path 883C 00 BRK . \to library path 883D 0A ASL A . \(dir, volume and drive) 883E 10 03 BPL &8843 .. 8840 38 SEC 8 \breakout ROM call and exit. 8841 60 RTS ` 8842 20 80 89 JSR &8980 .. \*INFO 8845 20 03 A6 JSR &A603 .. \get afsp, exist!, unpack cat 8848 20 06 A4 JSR &A406 .. \print *INFO line 884B 20 09 90 JSR &9009 .. \print newline 884E 20 0F A5 JSR &A50F .. \find next match of afsp 8851 90 F2 BCC &8845 .. \loop, else breakout and exit. 8853 60 RTS ` 8854 98 TYA . \*RENAME 8855 48 PHA H \save command line pointer 8856 20 12 93 JSR &9312 .. \get file spec 8859 20 0F 93 JSR &930F .. \get entry name 885C 68 PLA h \(to check syntax) 885D A8 TAY . \restore command line pointer 885E 20 12 93 JSR &9312 .. \get file spec 8861 20 83 89 JSR &8983 .. \check file exists 8864 20 21 A5 JSR &A521 !. \check file not locked 8867 A5 CC LDA &CC .. \get pointer to cat entry 8869 48 PHA H \save it 886A 20 0F 93 JSR &930F .. \get new entry name 886D 20 09 A5 JSR &A509 .. \try to find it in cat 8870 B0 11 BCS &8883 .. \if present 8872 20 18 90 JSR &9018 .. \then "File exists" error 8875 0A ASL A . 8876 C4 46 CPY &46 .F 8878 69 6C ADC #&6C 01101100 887A 65 20 ADC &20 e 887C 65 78 ADC &78 ex 887E 69 73 ADC #&73 01110011 8880 74 ??? t 8881 73 ??? s 8882 00 BRK . 8883 68 PLA h \else restore cat pointer 8884 AA TAX . 8885 20 09 92 JSR &9209 .. \copy immediate filename 8888 C0 00 CPY #&00 00000000 \into catalogue at index X+8 888A 08 PHP . 888B 0E 08 02 ASL &0208 ... 888E 4C B4 88 JMP &88B4 L.. \jump to write cat and exit. 8891 20 06 92 JSR &9206 .. \*TITLE 8894 00 BRK . \copy default path to immed 8895 10 C0 BPL &8857 .. 8897 00 BRK . 8898 0A ASL A . 8899 20 00 9B JSR &9B00 .. \load catalogue 889C A2 00 LDX #&00 00000000 \clear index register 889E 20 1E 93 JSR &931E .. \get character of string 88A1 9D 00 0E STA &0E00,X ... \store in first part of title 88A4 E8 INX . \increment index register 88A5 E0 08 CPX #&08 00001000 \is it now 8 or more? 88A7 D0 F5 BNE &889E .. \if not loop 88A9 20 1E 93 JSR &931E .. \else get character of string 88AC 9D F8 0E STA &0EF8,X ... \store in last part of title 88AF E8 INX . \increment index register 88B0 E0 0C CPX #&0C 00001100 \is it 12 or more? 88B2 D0 F5 BNE &88A9 .. \if not loop 88B4 20 03 9B JSR &9B03 .. \else write catalogue 88B7 38 SEC 8 \breakout ROM call and exit. 88B8 60 RTS ` 88B9 20 80 89 JSR &8980 .. \*WIPE 88BC 20 03 A6 JSR &A603 .. \get afsp, exist!, unpack cat 88BF 20 03 A4 JSR &A403 .. \print directory and filename 88C2 AD 47 10 LDA &1047 .G. \get attribute bit 88C5 10 06 BPL &88CD .. \if locked 88C7 20 09 90 JSR &9009 .. \then print newline 88CA 4C E3 88 JMP &88E3 L.. \and loop to next file 88CD 20 18 90 JSR &9018 .. \ask " : delete?" 88D0 10 20 BPL &88F2 . 88D2 3A ??? : 88D3 20 64 65 JSR &6564 de 88D6 6C 65 74 JMP (&7465) let 88D9 65 00 ADC &00 e. 88DB D0 06 BNE &88E3 .. \if user answers no then loop 88DD 20 00 A6 JSR &A600 .. \else delete entry 88E0 20 03 9B JSR &9B03 .. \and write catalogue. 88E3 20 0F A5 JSR &A50F .. \find next match of afsp 88E6 90 D4 BCC &88BC .. \and loop else breakout +exit. 88E8 60 RTS ` 88E9 BD 09 10 LDA &1009,X ... \Print " :"+path 88EC 20 18 90 JSR &9018 .. \x=0 default path 88EF C0 20 CPY #&20 00100000 \x=3 library path 88F1 3A ??? : \get drive, print " :"+drive 88F2 00 BRK . 88F3 BD 08 10 LDA &1008,X ... \get volume letter 88F6 20 00 90 JSR &9000 .. \print character in A 88F9 A9 2E LDA #&2E 00101110 \set A=dot 88FB 20 00 90 JSR &9000 .. \print character in A 88FE BD 07 10 LDA &1007,X ... \print directory and exit. 8901 4C 00 90 JMP &9000 L.. 8904 20 18 90 JSR &9018 .. \Print " n tracks" 8907 80 ??? . \where number is in A 8908 20 20 00 JSR &0020 . \start with " "+number 890B 20 18 90 JSR &9018 .. \print " tracks" and exit. 890E 00 BRK . 890F 20 74 72 JSR &7274 tr 8912 61 63 ADC (&63,X) ac 8914 6B ??? k 8915 73 ??? s 8916 00 BRK . 8917 60 RTS ` 8918 85 A8 STA &A8 .. \List files in dir 891A 20 89 89 JSR &8989 .. \A=0 immed dir, A=&80 all dirs 891D B0 60 BCS &897F .` \select first file in cat para 891F 20 6B 89 JSR &896B k. \if none exit else print newline 8922 A6 CC LDX &CC .. \set X = catalogue pointer 8924 86 A9 STX &A9 .. \store in temp 8926 20 09 92 JSR &9209 .. \copy catalogue entry 8929 08 PHP . \to immediate name and directory 892A 0E C0 00 ASL &00C0 ... 892D 08 PHP . 892E 20 20 8F JSR &8F20 . \select next file in cat para 8931 89 ??? . 8932 B0 07 BCS &893B .. \if no more files then break out 8934 20 1B A5 JSR &A51B .. \else compare immed - cat entry 8937 90 F6 BCC &892F .. \if cat entry > immed then loop 8939 B0 E7 BCS &8922 .. \else loop to set new 'minimum'. 893B 20 06 92 JSR &9206 .. \copy immediate filename and dir 893E C0 00 CPY #&00 00000000 \to catalogue workspace 8940 40 RTI @ 8941 10 08 BPL &894B .. 8943 20 03 90 JSR &9003 .. \print space 8946 24 A8 BIT &A8 $. \test directory flag 8948 30 0C BMI &8956 0. \if current dir only 894A 20 03 90 JSR &9003 .. \then print two spaces 894D 20 03 90 JSR &9003 .. \to replace directory and dot 8950 20 00 A4 JSR &A400 .. \print filename 8953 4C 59 89 JMP &8959 LY. \and jump forward 8956 20 03 A4 JSR &A403 .. \else print dir and filename. 8959 A6 A9 LDX &A9 .. \get temp value 895B 86 CC STX &CC .. \restore to catalogue pointer 895D 20 00 A6 JSR &A600 .. \delete catalogue entry 8960 20 89 89 JSR &8989 .. \select first file in cat para 8963 B0 06 BCS &896B .. \if no more print nl and exit 8965 20 73 89 JSR &8973 s. \else tab to next 20-column 8968 4C 22 89 JMP &8922 L". \&loopfor next file in cat para. 896B 20 09 90 JSR &9009 .. \Print newline +reset: 896E 48 PHA H \Reset column COUNT = 0 896F A9 00 LDA #&00 00000000 8971 F0 09 BEQ &897C .. 8973 48 PHA H \Tab to next 20-column 8974 A5 AA LDA &AA .. 8976 18 CLC . 8977 69 14 ADC #&14 00010100 8979 20 06 90 JSR &9006 .. 897C 85 AA STA &AA .. 897E 68 PLA h 897F 60 RTS ` 8980 20 15 93 JSR &9315 .. \get afsp 8983 20 00 9B JSR &9B00 .. \load catalogue 8986 4C 0C A5 JMP &A50C L.. \and check file exists. 8989 20 00 A5 JSR &A500 .. \Select first file in cat para 898C 4C 92 89 JMP &8992 L.. \select 1st file and jump 898F 20 06 A5 JSR &A506 .. \Select next file in cat para 8992 B0 0A BCS &899E .. \if no more files then exit C=1 8994 24 A8 BIT &A8 $. \else test directory flag 8996 30 05 BMI &899D 0. \if b7=1 then exit C=0 8998 20 1E A5 JSR &A51E .. \else compare directory letters 899B D0 F2 BNE &898F .. \if mismatch then loop 899D 18 CLC . \else exit C=0 899E 60 RTS ` \'Medium' DFS commands 8A00 4C 15 8A JMP &8A15 L.. \*BACKUP 8A03 4C D3 8A JMP &8AD3 L.. \*COMPACT 8A06 4C 64 8B JMP &8B64 Ld. \*COPY 8A09 4C E7 8B JMP &8BE7 L.. \*ENABLE 8A0C 4C FA 8C JMP &8CFA L.. \Ask user for confirmation 8A0F 4C 77 8B JMP &8B77 Lw. \*SCOPY 8A12 4C A5 8B JMP &8BA5 L.. \*FCOPY 8A15 20 00 93 JSR &9300 .. \*BACKUP 8A18 A5 C9 LDA &C9 .. \get drive spec 8A1A 8D 70 10 STA &1070 .p. \store source drive in workspace 8A1D 20 00 93 JSR &9300 .. \get drive spec 8A20 A5 C9 LDA &C9 .. 8A22 8D 71 10 STA &1071 .q. \store dest drive in workspace 8A25 A9 00 LDA #&00 00000000 \clear source volume 8A27 8D 72 10 STA &1072 .r. 8A2A 8D 73 10 STA &1073 .s. \and target volume 8A2D AD 70 10 LDA &1070 .p. \print "Copying from drive " 8A30 20 18 90 JSR &9018 .. \+source drive 8A33 C0 43 CPY #&43 01000011 8A35 6F ??? o 8A36 70 79 BVS &8AB1 py 8A38 69 6E ADC #&6E 01101110 8A3A 67 ??? g 8A3B 20 66 72 JSR &7266 fr 8A3E 6F ??? o 8A3F 6D 20 64 ADC &6420 m d 8A42 72 ??? r 8A43 69 76 ADC #&76 01110110 8A45 65 20 ADC &20 e 8A47 00 BRK . 8A48 AD 71 10 LDA &1071 .q. 8A4B 20 18 90 JSR &9018 .. \print " to drive "+target+nl 8A4E C2 ??? . 8A4F 20 74 6F JSR &6F74 to 8A52 20 64 72 JSR &7264 dr 8A55 69 76 ADC #&76 01110110 8A57 65 20 ADC &20 e 8A59 00 BRK . 8A5A 20 77 8D JSR &8D77 w. \initialise and load source disc 8A5D 20 FF 8B JSR &8BFF .. \set up prompt flag 8A60 AE 70 10 LDX &1070 .p. \get source drive for use later 8A63 BD F4 0F LDA &0FF4,X ... \get no. tracks on source drive 8A66 8D 81 10 STA &1081 ... \store temp 8A69 BD F0 0F LDA &0FF0,X ... \get density of source drive 8A6C 48 PHA H \push density 8A6D 20 B7 8D JSR &8DB7 .. \swap source and target discs 8A70 20 91 8D JSR &8D91 .. \ensure catalogue loaded 8A73 AE 71 10 LDX &1071 .q. \get target drive for use later 8A76 68 PLA h \pop source density 8A77 DD F0 0F CMP &0FF0,X ... \compare with target density 8A7A D0 3F BNE &8ABB .? \if unequal "Incompatible discs" 8A7C AD 81 10 LDA &1081 ... \else get source tracks 8A7F DD F4 0F CMP &0FF4,X ... \compare with target tracks 8A82 D0 37 BNE &8ABB .7 \if unequal "Incompatible discs" 8A84 A9 00 LDA #&00 00000000 \else clear src sectors-to-go 8A86 8D 76 10 STA &1076 .v. 8A89 8D 78 10 STA &1078 .x. 8A8C 8D 79 10 STA &1079 .y. \and high byte of target stg. 8A8F BD F0 0F LDA &0FF0,X ... \get target sectors per track 8A92 18 CLC . 8A93 6D 76 10 ADC &1076 mv. \increase stg counts by this 8A96 8D 76 10 STA &1076 .v. 8A99 8D 77 10 STA &1077 .w. 8A9C 90 06 BCC &8AA4 .. \carry out to high bytes 8A9E EE 78 10 INC &1078 .x. 8AA1 EE 79 10 INC &1079 .y. 8AA4 CE 81 10 DEC &1081 ... \loop until all tracks done. 8AA7 D0 E6 BNE &8A8F .. 8AA9 AD 71 10 LDA &1071 .q. \get target drive 8AAC 09 80 ORA #&80 10000000 \set top bit 8AAE 20 0C 8A JSR &8A0C .. \confirm wipe of disc and memory 8AB1 90 06 BCC &8AB9 .. \if No then exit 8AB3 20 58 8E JSR &8E58 X. \else copy the disc 8AB6 20 58 8E JSR &8E58 X. \and make sure it is all done. 8AB9 38 SEC 8 \break out of ROM call and exit 8ABA 60 RTS ` 8ABB 20 18 90 JSR &9018 .. \Error "Incompatible discs" 8ABE 0A ASL A . 8ABF D3 ??? . 8AC0 49 6E EOR #&6E 01101110 8AC2 63 ??? c 8AC3 6F ??? o 8AC4 6D 70 61 ADC &6170 mpa 8AC7 74 ??? t 8AC8 69 62 ADC #&62 01100010 8ACA 6C 65 20 JMP (&2065) le 8ACD 64 ??? d 8ACE 69 73 ADC #&73 01110011 8AD0 63 ??? c 8AD1 73 ??? s 8AD2 00 BRK . 8AD3 20 EE 8B JSR &8BEE .. \*COMPACT 8AD6 20 F3 8B JSR &8BF3 .. \get and store volume spec 8AD9 20 77 8D JSR &8D77 w. \store it as 'target' volume too 8ADC A9 80 LDA #&80 10000000 \initialise & load source disc 8ADE 8D 80 10 STA &1080 ... \set flag for single disc oper'n 8AE1 A2 00 LDX #&00 00000000 \set &106B,C = &0001 8AE3 8E 6C 10 STX &106C .l. \to search for one free sector 8AE6 E8 INX . 8AE7 8E 6B 10 STX &106B .k. 8AEA 20 0C A6 JSR &A60C .. \find a free space in volume 8AED B0 5B BCS &8B4A .[ \(not at end!) if not found quit 8AEF 20 06 A5 JSR &A506 .. \else select next (a) file 8AF2 B0 56 BCS &8B4A .V \if no file found finish 8AF4 AD 70 10 LDA &1070 .p. \else get source drive 8AF7 20 18 90 JSR &9018 .. \print "Compacting vol "+n 8AFA C0 43 CPY #&43 01000011 8AFC 6F ??? o 8AFD 6D 70 61 ADC &6170 mpa 8B00 63 ??? c 8B01 74 ??? t 8B02 69 6E ADC #&6E 01101110 8B04 67 ??? g 8B05 20 76 6F JSR &6F76 vo 8B08 6C 20 00 JMP (&0020) l . 8B0B AD 72 10 LDA &1072 .r. \get source volume letter 8B0E 20 00 90 JSR &9000 .. \print it 8B11 20 09 90 JSR &9009 .. \print newline 8B14 A9 80 LDA #&80 10000000 \this routine wipes memory only 8B16 20 0C 8A JSR &8A0C .. \ask user for confirmation 8B19 90 2F BCC &8B4A ./ \if not given then finish 8B1B 20 03 A6 JSR &A603 .. \else unpack fields from cat 8B1E 20 CE 8E JSR &8ECE .. \copy entry from cat 1 to 2 8B21 20 00 A6 JSR &A600 .. \delete catalogue entry 8B24 20 2A 8F JSR &8F2A *. \set copy range = entry range 8B27 20 5B 8E JSR &8E5B [. \copy file 8B2A 98 TYA . \if a write is now due 8B2B D0 0D BNE &8B3A .. \then flush buffer &test if done 8B2D A6 CC LDX &CC .. \else get catalogue pointer 8B2F 20 06 A5 JSR &A506 .. \select next 'source' file 8B32 90 E7 BCC &8B1B .. \and loop if one is found 8B34 20 B7 8D JSR &8DB7 .. \else 'swap discs' 8B37 4C 27 8B JMP &8B27 L'. \and loop back to tidy up. 8B3A E4 AB CPX &AB .. \if all files have been saved 8B3C F0 09 BEQ &8B47 .. \then finish 8B3E 20 F0 8E JSR &8EF0 .. \else unpack cat 2 entry 8B41 20 45 8F JSR &8F45 E. \create catalogue entry +*INFO 8B44 4C 24 8B JMP &8B24 L$. \& loop back to save this file. 8B47 20 03 9B JSR &9B03 .. \Finish *COMPACT.write catalogue 8B4A 20 1B A6 JSR &A61B .. \get free space on volume 8B4D 20 09 A4 JSR &A409 .. \print decimal word 8B50 20 18 90 JSR &9018 .. \print " free sectors"+newline 8B53 02 ??? . 8B54 20 66 72 JSR &7266 fr 8B57 65 65 ADC &65 ee 8B59 20 73 65 JSR &6573 se 8B5C 63 ??? c 8B5D 74 ??? t 8B5E 6F ??? o 8B5F 72 ??? r 8B60 73 ??? s 8B61 00 BRK . 8B62 38 SEC 8 \and exit C=1. 8B63 60 RTS ` 8B64 20 DC 8C JSR &8CDC .. \*COPY 8B67 90 3A BCC &8BA3 .: \process args, if user aborts 8B69 20 03 A6 JSR &A603 .. \then exit else unpack fields 8B6C 20 49 8C JSR &8C49 I. \copy cat 1 to 2 and copy file 8B6F 20 0F A5 JSR &A50F .. \find next match of afsp 8B72 90 F5 BCC &8B69 .. \and loop if one is found 8B74 4C 5B 8C JMP &8C5B L[. \else flush copy buffer &exit. 8B77 20 DC 8C JSR &8CDC .. \*SCOPY 8B7A 90 27 BCC &8BA3 .' \process args, if user aborts 8B7C 20 03 A6 JSR &A603 .. \then exit else unpack fields 8B7F 20 03 A4 JSR &A403 .. \print directory and filename 8B82 20 18 90 JSR &9018 .. \ask " : copy?" 8B85 10 20 BPL &8BA7 . 8B87 3A ??? : 8B88 20 63 6F JSR &6F63 co 8B8B 70 79 BVS &8C06 py 8B8D 00 BRK . 8B8E D0 0E BNE &8B9E .. \if user answers yes, then: 8B90 20 49 8C JSR &8C49 I. \copy cat 1 to 2 and copy file 8B93 20 5B 8C JSR &8C5B [. \flush copy buffer 8B96 20 B7 8D JSR &8DB7 .. \swap discs (to reselect source) 8B99 20 91 8D JSR &8D91 .. \ensure catalogue loaded 8B9C 86 CC STX &CC .. \save catalogue pointer 8B9E 20 0F A5 JSR &A50F .. \find next match of afsp 8BA1 90 D9 BCC &8B7C .. \and loop if one is found 8BA3 38 SEC 8 \else exit C=1. 8BA4 60 RTS ` 8BA5 20 12 93 JSR &9312 .. \*FCOPY 8BA8 A2 00 LDX #&00 00000000 \get source file spec 8BAA 20 F3 8B JSR &8BF3 .. \store source vol for copier 8BAD 20 06 92 JSR &9206 .. \copy immediate filename+dir 8BB0 C0 00 CPY #&00 00000000 \to catalogue block 1 8BB2 40 RTI @ \(source filename) 8BB3 10 08 BPL &8BBD .. 8BB5 20 12 93 JSR &9312 .. \get target file spec 8BB8 20 F3 8B JSR &8BF3 .. \store target vol for copier 8BBB 20 06 92 JSR &9206 .. \copy immediate filename+dir 8BBE C0 00 CPY #&00 00000000 \to catalogue block 2 8BC0 58 CLI X \(target filename) 8BC1 10 08 BPL &8BCB .. 8BC3 20 06 92 JSR &9206 .. \copy catalogue block 1 8BC6 40 RTI @ \back to immediate filename+dir 8BC7 10 C0 BPL &8B89 .. \(source filename) 8BC9 00 BRK . 8BCA 08 PHP . 8BCB 20 98 8C JSR &8C98 .. \init copy, find source file 8BCE 20 F8 8C JSR &8CF8 .. \ask to overwrite memory 8BD1 90 D0 BCC &8BA3 .. \if refused exit C=1 8BD3 20 03 A6 JSR &A603 .. \else unpack fields from cat 8BD6 A6 CC LDX &CC .. \get catalogue pointer in X 8BD8 20 09 92 JSR &9209 .. \copy target filename+dir 8BDB 58 CLI X \to catalogue entry 8BDC 10 08 BPL &8BE6 .. \temporarily renaming the file 8BDE 0E 08 02 ASL &0208 ... 8BE1 20 49 8C JSR &8C49 I. \copy cat to cat2 and copy file 8BE4 4C 5B 8C JMP &8C5B L[. \flush copy buffer &exit. 8BE7 A9 02 LDA #&02 00000010 \*ENABLE 8BE9 8D 0F 10 STA &100F ... \set enabled flag b1=1 8BEC 38 SEC 8 \break out of ROM call 8BED 60 RTS ` \and exit 8BEE A2 00 LDX #&00 00000000 \Get and store source vol spec: 8BF0 20 03 93 JSR &9303 .. \Get and store dest vol spec 8BF3 A5 C8 LDA &C8 .. \get volume letter of spec 8BF5 9D 72 10 STA &1072,X .r. \store it in source/dest info 8BF8 A5 C9 LDA &C9 .. \get drive letter of spec 8BFA 9D 70 10 STA &1070,X .p. \store it in source/dest info 8BFD E8 INX . \move pointer from src to dest. 8BFE 60 RTS ` 8BFF AD 72 10 LDA &1072 .r. \Set up prompt flag 8C02 CD 73 10 CMP &1073 .s. \compare src and target volumes 8C05 D0 08 BNE &8C0F .. \if equal, then: 8C07 AD 70 10 LDA &1070 .p. \compare src and target drives 8C0A CD 71 10 CMP &1071 .q. \if equal,discs must be distinct 8C0D F0 34 BEQ &8C43 .4 \so jump to set prompt bit 8C0F AD 70 10 LDA &1070 .p. \else get source drive 8C12 4D 71 10 EOR &1071 Mq. \XOR target drive 8C15 29 01 AND #&01 00000001 \A=1 iff different units 8C17 D0 2F BNE &8C48 ./ \if so then exit 8C19 20 18 90 JSR &9018 .. \else ask 8C1C 10 41 BPL &8C5F .A \"Are source and target 8C1E 72 ??? r \the same disc?" 8C1F 65 20 ADC &20 e 8C21 73 ??? s 8C22 6F ??? o 8C23 75 72 ADC &72,X ur 8C25 63 ??? c 8C26 65 20 ADC &20 e 8C28 61 6E ADC (&6E,X) an 8C2A 64 ??? d 8C2B 20 74 61 JSR &6174 ta 8C2E 72 ??? r 8C2F 67 ??? g 8C30 65 74 ADC &74 et 8C32 20 74 68 JSR &6874 th 8C35 65 20 ADC &20 e 8C37 73 ??? s 8C38 61 6D ADC (&6D,X) am 8C3A 65 20 ADC &20 e 8C3C 64 ??? d 8C3D 69 73 ADC #&73 01110011 8C3F 63 ??? c 8C40 00 BRK . 8C41 F0 05 BEQ &8C48 .. \if Yes then exit 8C43 A9 40 LDA #&40 01000000 \else set prompt flag. 8C45 8D 80 10 STA &1080 ... \exit 8C48 60 RTS ` 8C49 20 CE 8E JSR &8ECE .. \copy entry from cat 1 to 2: \Copy file. Fulfils the entry now in catalogue block 2. \On entry if Y=0 then the file's contents are read from the source \disc into the data buffer. \If Y=1 then the file's contents are written from the data buffer \on to the target disc, and the rest of the copy buffer is flushed. 8C4C 20 2A 8F JSR &8F2A *. \Copy file 8C4F 20 5B 8E JSR &8E5B [. \set copy range = entry range 8C52 98 TYA . \read/write range to buffer 8C53 D0 09 BNE &8C5E .. \if write now due, flush else: 8C55 20 91 8D JSR &8D91 .. \ensure catalogue loaded 8C58 86 CC STX &CC .. \save catalogue ptr and exit. 8C5A 60 RTS ` 8C5B 20 58 8E JSR &8E58 X. \write(?) range, then: 8C5E E4 AB CPX &AB .. \Flush copy buffer. if empty 8C60 F0 31 BEQ &8C93 .1 \then flush cat 1 and exit C=1 8C62 20 F0 8E JSR &8EF0 .. \else unpack cat 2 entry 8C65 20 91 8D JSR &8D91 .. \ensure catalogue loaded 8C68 20 06 92 JSR &9206 .. \copy immediate filename+dir 8C6B C0 00 CPY #&00 00000000 \to catalogue block 1 8C6D 40 RTI @ \which has attribs from cat 2 8C6E 10 08 BPL &8C78 .. \(save filename being read) 8C70 20 06 92 JSR &9206 .. \copy catalogue block 2 8C73 58 CLI X \to immediate filename+dir 8C74 10 C0 BPL &8C36 .. \(target file name) 8C76 00 BRK . 8C77 08 PHP . 8C78 20 09 A5 JSR &A509 .. \find file in catalogue 8C7B B0 06 BCS &8C83 .. \if not found skip, else: 8C7D 20 21 A5 JSR &A521 !. \check file not locked 8C80 20 00 A6 JSR &A600 .. \delete catalogue entry 8C83 20 06 92 JSR &9206 .. \copy catalogue block 1 8C86 40 RTI @ \to immediate filename+dir 8C87 10 C0 BPL &8C49 .. \(restore filename being read) 8C89 00 BRK . 8C8A 08 PHP . 8C8B 20 45 8F JSR &8F45 E. \create cat entry +*INFO 8C8E E6 A8 INC &A8 .. \mark catalogue page as dirty 8C90 4C 4C 8C JMP &8C4C LL. \and go back to Copy file! 8C93 20 A7 8D JSR &8DA7 .. \Flush catalogue, exit C=1 8C96 38 SEC 8 8C97 60 RTS ` 8C98 20 77 8D JSR &8D77 w. \Initialise copy 8C9B 20 0C A5 JSR &A50C .. \init+cat, check file exists 8C9E AD 06 0F LDA &0F06 ... \get top 3 bits of disc size 8CA1 8D 81 10 STA &1081 ... \(+boot option), store 1081 8CA4 AD 70 10 LDA &1070 .p. \get source drive 8CA7 20 18 90 JSR &9018 .. \print "Copying from vol "+n 8CAA C0 43 CPY #&43 01000011 8CAC 6F ??? o 8CAD 70 79 BVS &8D28 py 8CAF 69 6E ADC #&6E 01101110 8CB1 67 ??? g 8CB2 20 66 72 JSR &7266 fr 8CB5 6F ??? o 8CB6 6D 20 76 ADC &7620 m v 8CB9 6F ??? o 8CBA 6C 20 00 JMP (&0020) l . 8CBD AD 72 10 LDA &1072 .r. \get source vol letter 8CC0 20 00 90 JSR &9000 .. \print it 8CC3 AD 71 10 LDA &1071 .q. \get target drive 8CC6 20 18 90 JSR &9018 .. \print " to vol "+n 8CC9 C0 20 CPY #&20 00100000 8CCB 74 ??? t 8CCC 6F ??? o 8CCD 20 76 6F JSR &6F76 vo 8CD0 6C 20 00 JMP (&0020) l . 8CD3 AD 73 10 LDA &1073 .s. \get target volume 8CD6 20 00 90 JSR &9000 .. \print it 8CD9 4C 09 90 JMP &9009 L.. \print newline and exit. 8CDC 20 EE 8B JSR &8BEE .. \Process *COPY, *SCOPY arguments 8CDF 20 F0 8B JSR &8BF0 .. \get &store src & dest vol specs 8CE2 20 15 93 JSR &9315 .. \get ambiguous file spec 8CE5 20 98 8C JSR &8C98 .. \initialise copy 8CE8 20 FF 8B JSR &8BFF .. \set up prompt flag 8CEB 2C 80 10 BIT &1080 ,.. \copy prompt bit of flag to b0 8CEE 50 08 BVC &8CF8 P. 8CF0 A9 01 LDA #&01 00000001 8CF2 0D 80 10 ORA &1080 ... 8CF5 8D 80 10 STA &1080 ... 8CF8 A9 80 LDA #&80 10000000 \Ask to overwrite memory only: 8CFA 0A ASL A . \Ask user for confirmation 8CFB 90 1A BCC &8D17 .. \if b0=1 caller will wipe memory 8CFD 2C 7A 02 BIT &027A ,z. \so test Tube presence 8D00 30 15 BMI &8D17 0. \if present I/O is free to wipe 8D02 20 53 8D JSR &8D53 S. \else ensure *ENABLEd or warn 8D05 B0 4A BCS &8D51 .J \if *ENABLED exit C=1 8D07 20 18 90 JSR &9018 .. \complete warning of memory loss 8D0A 02 ??? . 8D0B 75 73 ADC &73,X us 8D0D 65 72 ADC &72 er 8D0F 20 6D 65 JSR &656D me 8D12 6D 6F 72 ADC &726F mor 8D15 79 00 4A ADC &4A00,Y y.J \if b1=1 caller will wipe disc 8D18 F0 18 BEQ &8D32 .. \drive number in b2..3,now b0..1 8D1A 20 53 8D JSR &8D53 S. \ensure *ENABLED or warn 8D1D B0 32 BCS &8D51 .2 \if *ENABLED exit C=1 8D1F 20 18 90 JSR &9018 .. \finish warning of disc erasure 8D22 C2 ??? . 8D23 64 ??? d 8D24 69 73 ADC #&73 01110011 8D26 63 ??? c 8D27 20 69 6E JSR &6E69 in 8D2A 20 64 72 JSR &7264 dr 8D2D 69 76 ADC #&76 01110110 8D2F 65 20 ADC &20 e 8D31 00 BRK . 8D32 20 18 90 JSR &9018 .. \Ask if user wants to proceed 8D35 15 44 ORA &44,X .D \(yes/no) 8D37 6F ??? o 8D38 20 79 6F JSR &6F79 yo 8D3B 75 20 ADC &20,X u 8D3D 77 ??? w 8D3E 61 6E ADC (&6E,X) an 8D40 74 ??? t 8D41 20 74 6F JSR &6F74 to 8D44 20 70 72 JSR &7270 pr 8D47 6F ??? o 8D48 63 ??? c 8D49 65 65 ADC &65 ee 8D4B 64 ??? d 8D4C 00 BRK . 8D4D F0 02 BEQ &8D51 .. \Z=yes, if so exit C=1 8D4F 18 CLC . \else exit C=0. 8D50 60 RTS ` 8D51 38 SEC 8 \exit C=1 8D52 60 RTS ` 8D53 4E 0F 10 LSR &100F N.. \Print warning 8D56 B0 1E BCS &8D76 .. \return C=*ENABLEd 8D58 20 18 90 JSR &9018 .. \if not *ENABLEd 8D5B 01 57 ORA (&57,X) .W \begin warning message. 8D5D 41 52 EOR (&52,X) AR 8D5F 4E 49 4E LSR &4E49 NIN 8D62 47 ??? G 8D63 3A ??? : 8D64 20 77 69 JSR &6977 wi 8D67 6C 6C 20 JMP (&206C) ll 8D6A 6F ??? o 8D6B 76 65 ROR &65,X ve 8D6D 72 ??? r 8D6E 77 ??? w 8D6F 72 ??? r 8D70 69 74 ADC #&74 01110100 8D72 65 20 ADC &20 e 8D74 00 BRK . 8D75 18 CLC . 8D76 60 RTS ` 8D77 A9 00 LDA #&00 00000000 \Initialise and load source disc 8D79 A8 TAY . \clear A,Y 8D7A 85 AB STA &AB .. \and &AB 8D7C A2 0B LDX #&0B 00001011 \and &1076..81 8D7E 9D 76 10 STA &1076,X .v. 8D81 CA DEX . 8D82 10 FA BPL &8D7E .. 8D84 A9 13 LDA #&13 00010011 \=8271 read cmd for source drive 8D86 8D 74 10 STA &1074 .t. 8D89 A9 0B LDA #&0B 00001011 \=write command for target 8D8B 8D 75 10 STA &1075 .u. 8D8E 20 C7 8D JSR &8DC7 .. \ask for disc, then: 8D91 48 PHA H \Ensure catalogue loaded 8D92 A5 A8 LDA &A8 .. \get catalogue flag 8D94 D0 0F BNE &8DA5 .. \if catalogue empty 8D96 A5 C8 LDA &C8 .. \then get immediate volume; 8D98 F0 06 BEQ &8DA0 .. \if <>NUL 8D9A 20 00 9B JSR &9B00 .. \then load volume catalogue 8D9D 4C A3 8D JMP &8DA3 L.. \else 8DA0 20 0C 9B JSR &9B0C .. \softmount disc. 8DA3 E6 A8 INC &A8 .. \flag = 1, catalogue clean 8DA5 68 PLA h \restore A and exit. 8DA6 60 RTS ` 8DA7 48 PHA H \Flush catalogue 8DA8 A5 A8 LDA &A8 .. \save A, get page flag 8DAA C9 02 CMP #&02 00000010 \if page is empty or clean 8DAC 90 07 BCC &8DB5 .. \then exit 8DAE 20 03 9B JSR &9B03 .. \else write catalogue 8DB1 A9 01 LDA #&01 00000001 \and mark page as clean. 8DB3 85 A8 STA &A8 .. 8DB5 68 PLA h \restore A and exit. 8DB6 60 RTS ` 8DB7 20 A7 8D JSR &8DA7 .. \Swap source and target discs 8DBA 48 PHA H \flush catalogue, save A 8DBB 8A TXA . 8DBC 99 7E 10 STA &107E,Y .~. \store current drive in temp 8DBF 98 TYA . \toggle source/target drive 8DC0 49 01 EOR #&01 00000001 8DC2 A8 TAY . 8DC3 BE 7E 10 LDX &107E,Y .~. \load other drive no. into X 8DC6 68 PLA h \restore A, then: 8DC7 20 00 92 JSR &9200 .. \Ask for disc 8DCA 2C 80 10 BIT &1080 ,.. \test flag 8DCD 50 3C BVC &8E0B P< \if prompt bit clear then skip 8DCF C0 00 CPY #&00 00000000 \else test Y 8DD1 D0 11 BNE &8DE4 .. \if Y>0 then ask for target 8DD3 20 18 90 JSR &9018 .. \else ask for source 8DD6 00 BRK . \print "Is source" 8DD7 49 73 EOR #&73 01110011 8DD9 20 73 6F JSR &6F73 so 8DDC 75 72 ADC &72,X ur 8DDE 63 ??? c 8DDF 65 00 ADC &00 e. 8DE1 4C F2 8D JMP &8DF2 L.. \and jump. 8DE4 20 18 90 JSR &9018 .. \print "Is target" 8DE7 00 BRK . 8DE8 49 73 EOR #&73 01110011 8DEA 20 74 61 JSR &6174 ta 8DED 72 ??? r 8DEE 67 ??? g 8DEF 65 74 ADC &74 et 8DF1 00 BRK . 8DF2 B9 70 10 LDA &1070,Y .p. \get source or target drv no. 8DF5 20 18 90 JSR &9018 .. \ask " disc in drive "+n+"?" 8DF8 D0 20 BNE &8E1A . 8DFA 64 ??? d 8DFB 69 73 ADC #&73 01110011 8DFD 63 ??? c 8DFE 20 69 6E JSR &6E69 in 8E01 20 64 72 JSR &7264 dr 8E04 69 76 ADC #&76 01110110 8E06 65 20 ADC &20 e 8E08 00 BRK . 8E09 D0 C4 BNE &8DCF .. \if No then loop and ask again! 8E0B 2C 80 10 BIT &1080 ,.. \else test flag 8E0E 30 04 BMI &8E14 0. \if b7 clear 8E10 A2 00 LDX #&00 00000000 \then mark catalogue empty. 8E12 86 A8 STX &A8 .. 8E14 B9 72 10 LDA &1072,Y .r. \get source/target volume 8E17 85 C8 STA &C8 .. \store immediate volume 8E19 B9 70 10 LDA &1070,Y .p. \get source/target drive 8E1C 85 C9 STA &C9 .. \store immediate drive 8E1E A9 83 LDA #&83 10000011 \call OSBYTE 8E20 20 F4 FF JSR &FFF4 .. \to get OSHWM (High Water Mark) 8E23 86 A9 STX &A9 .. \store in &A9,&AA 8E25 84 AA STY &AA .. \pointer to catalogue 8E27 C8 INY . \increase by two pages 8E28 C8 INY . 8E29 84 AC STY &AC .. \store in &AB(=00),&AC; 8E2B A9 84 LDA #&84 10000100 \pointer to buffer. 8E2D 20 F4 FF JSR &FFF4 .. \call OSBYTE to get HIMEM 8E30 98 TYA . \subtract start of buffer 8E31 38 SEC 8 8E32 E5 AC SBC &AC .. 8E34 90 0E BCC &8E44 .. \if HIMEM <= buffer 8E36 F0 0C BEQ &8E44 .. \then error "No free memory" 8E38 85 AD STA &AD .. \else store buffer size 8E3A AD 80 10 LDA &1080 ... \test flag 8E3D 4A LSR A J \if bit 1 set 8E3E 90 03 BCC &8E43 .. 8E40 20 91 8D JSR &8D91 .. \then ensure catalogue loaded 8E43 60 RTS ` \and exit. 8E44 20 18 90 JSR &9018 .. \error "No free memory" 8E47 0A ASL A . 8E48 D4 ??? . 8E49 4E 6F 20 LSR &206F No 8E4C 66 72 ROR &72 fr 8E4E 65 65 ADC &65 ee 8E50 20 6D 65 JSR &656D me 8E53 6D 6F 72 ADC &726F mor 8E56 79 00 20 ADC &2000,Y y. \Copy data between discs 8E59 B7 ??? . \JSR &8DB7 swap discs &flsh cat: 8E5A 8D B9 76 STA &76B9 ..v \LDA &1076,Y test src stg count 8E5D 10 19 BPL &8E78 .. \ORA &1078,Y OR low & high bytes 8E5F 78 SEI x 8E60 10 D0 BPL &8E32 .. \BNE &8E64 if =0 8E62 01 60 ORA (&60,X) .` \RTS then exit 8E64 A5 AC LDA &AC .. \else set O7F address 8E66 8D 12 10 STA &1012 ... \to address of data buffer 8E69 A9 00 LDA #&00 00000000 8E6B 8D 11 10 STA &1011 ... 8E6E A9 FF LDA #&FF 11111111 8E70 8D 13 10 STA &1013 ... 8E73 8D 14 10 STA &1014 ... 8E76 B9 74 10 LDA &1074,Y .t. \set command = Read for src disc 8E79 8D 16 10 STA &1016 ... \or Write for target disc 8E7C A5 AD LDA &AD .. \if buffer size = 0 8E7E F0 D8 BEQ &8E58 .. \then swap discs and start again 8E80 20 86 8E JSR &8E86 .. \else do disc transfer <= bufsiz 8E83 4C 5B 8E JMP &8E5B L[. \and start again. 8E86 20 00 92 JSR &9200 .. \Do disc transfer.A=sector count 8E89 BE 78 10 LDX &1078,Y .x. \if source stg <256 then 8E8C D0 08 BNE &8E96 .. 8E8E D9 76 10 CMP &1076,Y .v. \A = max(A, source stg). 8E91 90 03 BCC &8E96 .. 8E93 B9 76 10 LDA &1076,Y .v. 8E96 85 AE STA &AE .. \save sector count 8E98 84 AF STY &AF .. \save source/target in temp 8E9A BE 7A 10 LDX &107A,Y .z. \get low byte of start sector 8E9D B9 7C 10 LDA &107C,Y .|. \get high byte 8EA0 A8 TAY . \set XY = start sector 8EA1 A5 AE LDA &AE .. \get sector count in A 8EA3 20 06 9B JSR &9B06 .. \do LBA transfer 8EA6 98 TYA . \XY = last+1 sector 8EA7 A4 AF LDY &AF .. \restore Y=source or target 8EA9 99 7C 10 STA &107C,Y .|. \store high byte 8EAC 8A TXA . \store low byte 8EAD 99 7A 10 STA &107A,Y .z. 8EB0 B9 76 10 LDA &1076,Y .v. \subtract sector count from 8EB3 38 SEC 8 \source sectors-to-go 8EB4 E5 AE SBC &AE .. \first low byte 8EB6 99 76 10 STA &1076,Y .v. 8EB9 B9 78 10 LDA &1078,Y .x. \then borrow from high byte 8EBC E9 00 SBC #&00 00000000 8EBE 99 78 10 STA &1078,Y .x. 8EC1 AD 12 10 LDA &1012 ... \number of last+1 page 8EC4 85 AC STA &AC .. \store start of data buffer 8EC6 A5 AD LDA &AD .. \subtract sector count 8EC8 38 SEC 8 \from buffer size 8EC9 E5 AE SBC &AE .. 8ECB 85 AD STA &AD .. \exit. 8ECD 60 RTS ` 8ECE A6 CC LDX &CC .. \Copy entry from cat 1 to 2 8ED0 20 00 92 JSR &9200 .. \cat ptr to X then save AXY 8ED3 A4 AB LDY &AB .. \?&AB = offset in cat 2 8ED5 98 TYA . \put into A and Y 8ED6 18 CLC . \add 8 to A 8ED7 69 08 ADC #&08 00001000 8ED9 85 AB STA &AB .. \store as loop limit 8EDB BD 08 0E LDA &0E08,X ... \copy name part of cat entry 8EDE 91 A9 STA (&A9),Y .. \to catalogue buffer 8EE0 E6 AA INC &AA .. \point to next page up 8EE2 BD 08 0F LDA &0F08,X ... \copy attributes of cat entry 8EE5 91 A9 STA (&A9),Y .. \to catalogue buffer 8EE7 C6 AA DEC &AA .. \point to original page 8EE9 E8 INX . \increment offsets 8EEA C8 INY . 8EEB C4 AB CPY &AB .. \compare with loop limit 8EED D0 EC BNE &8EDB .. \if equal exit else loop. 8EEF 60 RTS ` 8EF0 20 00 92 JSR &9200 .. \Unpack catalogue 2 entry 8EF3 8A TXA . \x = offset in catalogue 2 8EF4 A8 TAY . \copy it to Y 8EF5 A2 00 LDX #&00 00000000 \then set X = 0 8EF7 B1 A9 LDA (&A9),Y .. \copy cat entry in buffer 2 8EF9 9D 40 10 STA &1040,X .@. \to packed area in cat block 1 8EFC E6 AA INC &AA .. 8EFE B1 A9 LDA (&A9),Y .. 8F00 9D 48 10 STA &1048,X .H. 8F03 C6 AA DEC &AA .. 8F05 E8 INX . 8F06 C8 INY . 8F07 E0 08 CPX #&08 00001000 8F09 D0 EC BNE &8EF7 .. 8F0B AD 06 0F LDA &0F06 ... \get cat 1 volume size high bits 8F0E 48 PHA H \save 8F0F AD 81 10 LDA &1081 ... \put cat 2's size in its place 8F12 8D 06 0F STA &0F06 ... \(to select 18/19 bit fields): 8F15 20 12 A6 JSR &A612 .. \unpack cat fields from wkspace 8F18 68 PLA h \and restore cat 1's size. 8F19 8D 06 0F STA &0F06 ... 8F1C 20 06 92 JSR &9206 .. \copy cat block 1 to block 2 8F1F 40 RTI @ 8F20 10 58 BPL &8F7A .X 8F22 10 18 BPL &8F3C .. 8F24 BA TSX . \return new offset in X 8F25 98 TYA . 8F26 9D 04 01 STA &0104,X ... \and exit. 8F29 60 RTS ` 8F2A 48 PHA H \Set copy range = entry range 8F2B AD 53 10 LDA &1053 .S. \get sector count low byte 8F2E 99 76 10 STA &1076,Y .v. \store sectors-to-go low byte 8F31 AD 54 10 LDA &1054 .T. \same with high byte 8F34 99 78 10 STA &1078,Y .x. \Y=0 selects source Y=1 target 8F37 AD 51 10 LDA &1051 .Q. \absolute start sector low 8F3A 99 7A 10 STA &107A,Y .z. \(LBA) 8F3D AD 52 10 LDA &1052 .R. \absolute start sector high 8F40 99 7C 10 STA &107C,Y .|. 8F43 68 PLA h \restore A and exit. 8F44 60 RTS ` 8F45 20 09 A6 JSR &A609 .. \Create catalogue entry 8F48 20 06 A4 JSR &A406 .. \print *INFO line 8F4B 4C 09 90 JMP &9009 L.. \print newline and exit \Console output subsystem 9000 4C 1B 90 JMP &901B L.. \Print character in A 9003 4C 54 90 JMP &9054 LT. \Print space 9006 4C 5C 90 JMP &905C L\. \Tab to column in A 9009 4C 7E 90 JMP &907E L~. \Display error message/newline 900C 4C D7 90 JMP &90D7 L.. \Print hex nibble 900F 4C CC 90 JMP &90CC L.. \Print hex byte 9012 4C F0 90 JMP &90F0 L.. \Print decimal byte 9015 4C B1 90 JMP &90B1 L.. \Print hex word absolute 9018 4C 19 91 JMP &9119 L.. \Print string immediate 901B 20 00 92 JSR &9200 .. \Print character in A 901E A4 F4 LDY &F4 .. 9020 B9 A1 02 LDA &02A1,Y ... \Get ROM type byte 9023 29 08 AND #&08 00001000 \if b3=1 then error message 9025 D0 1E BNE &9045 .. \so add the character to it 9027 AD 7C 02 LDA &027C .|. \else get *FX3 setting 902A 29 10 AND #&10 00010000 \is *SPOOL output disabled? 902C D0 10 BNE &903E .. \if so print the character 902E AD 7C 02 LDA &027C .|. \else disable *SPOOL output 9031 09 10 ORA #&10 00010000 9033 8D 7C 02 STA &027C .|. 9036 B9 A1 02 LDA &02A1,Y ... \and set b2=1 in ROM type byte 9039 09 04 ORA #&04 00000100 \indicating it had been enabled. 903B 99 A1 02 STA &02A1,Y ... 903E BA TSX . \get value in A on entry 903F BD 05 01 LDA &0105,X ... \print it with OSWRCH and exit. 9042 4C EE FF JMP &FFEE L.. 9045 BA TSX . \add character to error message: 9046 BD 05 01 LDA &0105,X ... \get value of A on entry 9049 AC 00 01 LDY &0100 ... \get offset to end of error 904C 99 00 01 STA &0100,Y ... \store character at end 904F C8 INY . \increment offset 9050 8C 00 01 STY &0100 ... \store it and exit. 9053 60 RTS ` 9054 48 PHA H \Print space 9055 A9 20 LDA #&20 00100000 9057 20 1B 90 JSR &901B .. 905A 68 PLA h 905B 60 RTS ` 905C 20 00 92 JSR &9200 .. \Tab to column in A 905F A4 F4 LDY &F4 .. \get ROM type byte 9061 B9 A1 02 LDA &02A1,Y ... 9064 29 08 AND #&08 00001000 \is b3=1, error msg in progress? 9066 30 EC BMI &9054 0. \if so print one space and exit 9068 20 54 90 JSR &9054 T. \else print a space 906B A9 86 LDA #&86 10000110 \get cursor position 906D 20 F4 FF JSR &FFF4 .. 9070 8A TXA . \if cursor in column 0 9071 F0 06 BEQ &9079 .. \then return A=0 9073 BA TSX . \else compare column number 9074 DD 05 01 CMP &0105,X ... \with value of A on entry 9077 90 EF BCC &9068 .. \if less print more spaces 9079 BA TSX . \else return A=X coordinate 907A 9D 05 01 STA &0105,X ... \of cursor 907D 60 RTS ` 907E 20 00 92 JSR &9200 .. \Display error message/newline 9081 A4 F4 LDY &F4 .. \get ROM type byte 9083 B9 A1 02 LDA &02A1,Y ... \clear b2..3 9086 48 PHA H 9087 29 F3 AND #&F3 11110011 9089 99 A1 02 STA &02A1,Y ... 908C 68 PLA h \if b3 was 1 908D 48 PHA H 908E 29 08 AND #&08 00001000 9090 D0 11 BNE &90A3 .. \do a BRK error message in stack 9092 20 E7 FF JSR &FFE7 .. \else print a newline 9095 68 PLA h 9096 29 04 AND #&04 00000100 \if b2 was 1 enable *SPOOL 9098 F0 08 BEQ &90A2 .. 909A AD 7C 02 LDA &027C .|. 909D 29 EF AND #&EF 11101111 909F 8D 7C 02 STA &027C .|. 90A2 60 RTS ` \and exit. 90A3 AC 00 01 LDY &0100 ... \error message.get length of err 90A6 A9 00 LDA #&00 00000000 \set NUL error message terminatr 90A8 99 00 01 STA &0100,Y ... 90AB 8D 00 01 STA &0100 ... \and BRK instruction over length 90AE 4C 00 01 JMP &0100 L.. \call BRK. 90B1 20 00 92 JSR &9200 .. \Print hex word absolute 90B4 20 03 92 JSR &9203 .. \address follows caller's JSR 90B7 85 B2 STA &B2 .. \store address in pointer 90B9 20 03 92 JSR &9203 .. 90BC 85 B3 STA &B3 .. 90BE BA TSX . \get status register on entry 90BF BD 06 01 LDA &0106,X ... 90C2 48 PHA H \C=print leading zeroes 90C3 28 PLP ( 90C4 A0 01 LDY #&01 00000001 \offset to top byte of word 90C6 20 CA 90 JSR &90CA .. \fetch high byte and print 90C9 88 DEY . \point to bottom byte 90CA B1 B2 LDA (&B2),Y .. \fetch it and fall through: 90CC 48 PHA H \Print hex byte 90CD 08 PHP . \upper nibble first 90CE 4A LSR A J 90CF 4A LSR A J 90D0 4A LSR A J 90D1 4A LSR A J 90D2 28 PLP ( 90D3 20 D7 90 JSR &90D7 .. 90D6 68 PLA h \then lower. Fall through: 90D7 48 PHA H \Print hex nibble 90D8 29 0F AND #&0F 00001111 \on entry C=print leading zeroes 90DA F0 01 BEQ &90DD .. \on exit C=a nonzero was printed 90DC 38 SEC 8 90DD 08 PHP . 90DE 09 20 ORA #&20 00100000 90E0 90 08 BCC &90EA .. 90E2 09 30 ORA #&30 00110000 90E4 C9 3A CMP #&3A 00111010 90E6 90 02 BCC &90EA .. 90E8 69 06 ADC #&06 00000110 90EA 20 1B 90 JSR &901B .. 90ED 28 PLP ( 90EE 68 PLA h 90EF 60 RTS ` 90F0 20 00 92 JSR &9200 .. \Print decimal byte 90F3 18 CLC . \C=0, suppress leading zeroes 90F4 A0 02 LDY #&02 00000010 \start with the hundreds 90F6 08 PHP . \digit loop, save C 90F7 A2 00 LDX #&00 00000000 \set quotient = 0 90F9 D9 16 91 CMP &9116,Y ... \subtract loop 90FC 90 07 BCC &9105 .. \if A>=placevalue 90FE E8 INX . \then increment quotient 90FF 38 SEC 8 \and subtract placevalue 9100 F9 16 91 SBC &9116,Y ... \from A 9103 D0 F4 BNE &90F9 .. \if A>0 subtract again 9105 28 PLP ( \else restore C 9106 48 PHA H \save remnant 9107 8A TXA . 9108 D0 02 BNE &910C .. \if quotient>0 then print it 910A 90 03 BCC &910F .. \if a leading zero skip it 910C 20 D7 90 JSR &90D7 .. \else print it 910F 68 PLA h \restore remnant 9110 88 DEY . \point to lower placevalue 9111 D0 E3 BNE &90F6 .. \if not units then loop 9113 38 SEC 8 \else units. set carry 9114 4C D7 90 JMP &90D7 L.. \to print unit even if 0. exit. 9117 0A ASL A . \placevalue 10 9118 64 ??? d \placevalue 100 9119 20 00 92 JSR &9200 .. \Print string immediate 911C 20 03 92 JSR &9203 .. \fetch immediate microcode byte 911F 48 PHA H \save it 9120 29 08 AND #&08 00001000 \if b3=1 9122 F0 0F BEQ &9133 .. 9124 A9 01 LDA #&01 00000001 \then bottom of stack page =1 9126 8D 00 01 STA &0100 ... 9129 A4 F4 LDY &F4 .. \get our ROM socket number 912B B9 A1 02 LDA &02A1,Y ... \get ROM type byte +flags 912E 09 08 ORA #&08 00001000 \set b3=1 9130 99 A1 02 STA &02A1,Y ... \store it back. 9133 68 PLA h \restore microcode byte 9134 A8 TAY . \copy to Y 9135 4A LSR A J \shift b0 into carry 9136 90 0A BCC &9142 .. \if b0=1 9138 A9 0A LDA #&0A 00001010 \then prepend a newline. 913A 20 1B 90 JSR &901B .. 913D A9 0D LDA #&0D 00001101 913F 20 1B 90 JSR &901B .. 9142 20 03 92 JSR &9203 .. \fetch immediate character 9145 F0 06 BEQ &914D .. \if =NUL break out of loop 9147 20 1B 90 JSR &901B .. \else print the character 914A 4C 42 91 JMP &9142 LB. \and loop. 914D BA TSX . \get A on entry 914E BD 05 01 LDA &0105,X ... 9151 C0 80 CPY #&80 10000000 \if microcode b7=1 9153 90 10 BCC &9165 .. 9155 C0 C0 CPY #&C0 11000000 \then if b6=1 9157 90 06 BCC &915F .. 9159 20 1B 90 JSR &901B .. \then 11.. print char in A. 915C 4C 6C 91 JMP &916C Ll. 915F 20 F0 90 JSR &90F0 .. \else 10.. print decimal in A. 9162 4C 6C 91 JMP &916C Ll. 9165 C0 40 CPY #&40 01000000 \else if b6=1 9167 90 03 BCC &916C .. 9169 20 CC 90 JSR &90CC .. \then 01.. print hex in A. 916C 98 TYA . \restore microcode byte 916D 29 02 AND #&02 00000010 \if b1=1 916F F0 03 BEQ &9174 .. 9171 20 7E 90 JSR &907E ~. \then display newline/error msg. 9174 98 TYA . \restore microcode byte 9175 29 04 AND #&04 00000100 \if b2=1 9177 F0 05 BEQ &917E .. 9179 A9 07 LDA #&07 00000111 \then send BEL to make a beep. 917B 20 1B 90 JSR &901B .. 917E 98 TYA . \restore microcode byte 917F 29 10 AND #&10 00010000 \if b4=1 9181 F0 45 BEQ &91C8 .E 9183 20 18 90 JSR &9018 .. \then re-enter! to print "? " 9186 00 BRK . 9187 3F ??? ? 9188 20 00 A2 JSR &A200 .. \call *FX 15,1 918B 01 A9 ORA (&A9,X) .. \to clear input buffer 918D 0F ??? . 918E 20 F4 FF JSR &FFF4 .. 9191 20 E0 FF JSR &FFE0 .. \call OSRDCH to GET character 9194 90 0C BCC &91A2 .. \if ESCAPE pressed 9196 20 18 90 JSR &9018 .. \then re-enter 9199 0A ASL A . \to print "Escape" error 919A 11 45 ORA (&45),Y .E 919C 73 ??? s 919D 63 ??? c 919E 61 70 ADC (&70,X) ap 91A0 65 00 ADC &00 e. 91A2 C9 59 CMP #&59 01011001 \is it "Y"? 91A4 F0 16 BEQ &91BC .. \then register Yes 91A6 C9 79 CMP #&79 01111001 \is it "y"? 91A8 F0 12 BEQ &91BC .. \then register Yes 91AA C9 4E CMP #&4E 01001110 \is it "N"? 91AC F0 04 BEQ &91B2 .. \then register No 91AE C9 6E CMP #&6E 01101110 \is it "n"? 91B0 D0 DF BNE &9191 .. \if not get another keypress. 91B2 20 18 90 JSR &9018 .. \else print "no" 91B5 02 ??? . \(A=&4E or &6E) 91B6 6E 6F 00 ROR &006F no. 91B9 C9 FF CMP #&FF 11111111 \return Z=0, C=0. 91BB 60 RTS ` 91BC 20 18 90 JSR &9018 .. \print "yes" 91BF 02 ??? . 91C0 79 65 73 ADC &7365,Y yes 91C3 00 BRK . 91C4 A9 00 LDA #&00 00000000 \return Z=1, C=1. 91C6 C9 00 CMP #&00 00000000 91C8 60 RTS ` \Macroassembly and miscellaneous 9200 4C 12 92 JMP &9212 L.. \Save AXY 9203 4C 47 92 JMP &9247 LG. \Get byte immediate 9206 4C 68 92 JMP &9268 Lh. \Copy memory absolute 9209 4C 6F 92 JMP &926F Lo. \Copy memory absolute indexed 920C 6C 1E 02 JMP (&021E) l.. \Issue Filing System Call 920F 4C 0F 92 JMP &920F L.. \Halt \Save AXY, to be restored when the calling routine exits. \At that point the status register will be passed back to the \superroutine as in a normal RTS. \On return to the caller the stack will contain (right to left): \&2E, &92, Y, X, A, P, return address(-1) low, return address(-1) high, \superroutine address(-1) low, superroutine address(-1) high \i.e. &0101,S = &2E; &0105,S = A. 9212 08 PHP . \Save AXY 9213 48 PHA H \actually we now save P, A, X, Y 9214 8A TXA . 9215 48 PHA H 9216 98 TYA . 9217 48 PHA H 9218 A9 92 LDA #&92 10010010 \Push the address (less one) 921A 48 PHA H \of the restore routine 921B A9 2E LDA #&2E 00101110 \at &922F 921D 48 PHA H 921E A0 06 LDY #&06 00000110 \set loop counter to 6: 9220 BA TSX . \get current stack pointer 9221 BD 08 01 LDA &0108,X ... \peek at the 8th value down 9224 48 PHA H \push it on top, and loop x6. 9225 88 DEY . \(duplicates return address 9226 D0 F8 BNE &9220 .. \and PAXY) 9228 68 PLA h \pop Y, X, A 9229 A8 TAY . 922A 68 PLA h 922B AA TAX . 922C 68 PLA h 922D 28 PLP ( \pop P and return to caller. 922E 60 RTS ` \Restore AXY. Invoked by the caller of "Save AXY" when it reaches \an RTS. \After the PHP the stack contains (right to left): \new P, old Y, X, A, P, return address(-1) low, return address(-1) high, \superroutine address(-1) low, superroutine address(-1) high \i.e. &0101,S = new P. 922F 08 PHP . \Restore AXY 9230 BA TSX . \push status register on entry 9231 BD 01 01 LDA &0101,X ... \peek its value into A 9234 9D 05 01 STA &0105,X ... \overwrite old status 9237 9D 06 01 STA &0106,X ... \and "Save AXY" return address 923A 9D 07 01 STA &0107,X ... 923D 68 PLA h \discard status on entry 923E 68 PLA h \pop Y, X, A 923F A8 TAY . 9240 68 PLA h 9241 AA TAX . 9242 68 PLA h 9243 28 PLP ( \pop three copies of status 9244 28 PLP ( 9245 28 PLP ( \and return to superroutine 9246 60 RTS ` \Get byte immediate. The caller has already called "Save AXY", \and before that the superroutine called the caller with JSR. \After this JSR instruction is a number of bytes for the subroutine \to process. This routine fetches the next byte for the subroutine \and advances the return address back to the superroutine. \During the TSX at &924A the stack contains (right to left): \&2E, &92, caller Y, X, A, P, \&49, &92, caller return address(-1) low, high, \&2E, &92, superroutine Y, X, A, P, \caller "save AXY" return address(-1) low, high, \superroutine return address(-1) low, high \therefore &0113..4,S = address of the immediate operand, less one. 9247 20 00 92 JSR &9200 .. \Get byte immediate 924A BA TSX . \save caller's AXY 924B 18 CLC . \get stack pointer 924C BD 13 01 LDA &0113,X ... \add 1 to superroutine 924F 69 01 ADC #&01 00000001 \return address 9251 9D 13 01 STA &0113,X ... \save result back on stack 9254 85 B0 STA &B0 .. \and as a pointer 9256 BD 14 01 LDA &0114,X ... \complete the addition 9259 69 00 ADC #&00 00000000 \on the high byte 925B 9D 14 01 STA &0114,X ... \save back on stack 925E 85 B1 STA &B1 .. \store high byte of pointer 9260 A0 00 LDY #&00 00000000 \clear index register 9262 B1 B0 LDA (&B0),Y .. \get byte at new pointer 9264 9D 05 01 STA &0105,X ... \return in A on exit. 9267 60 RTS ` \Copy memory absolute \The JSR instruction calling this routine is followed by: \2 bytes From address, 2 bytes To address, 1 byte length. \Copying proceeds upwards in memory. 9268 20 00 92 JSR &9200 .. \Copy memory absolute 926B A0 05 LDY #&05 00000101 \5 argument bytes 926D D0 05 BNE &9274 .. \and jump always \Copy memory absolute indexed \Arguments as for "Copy memory absolute", except there is a sixth byte: \bits 4 to 7 of this byte control indexing of the From address, \bits 0 and 1 control indexing of the To address. \When the field is all zeroes the relevant address is used as is; \otherwise one of the following values is added to the given address \to form an effective address where the transfer will start. \Bits Value to be added \0000 or 00 Zero \0001 or 01 Y on entry \0010 or 10 X on entry \0011 or 11 A on entry \0100 &71 \0101 &92 \0110 caller return address(-1) low byte \0111 caller return address(-1) high byte \1xxx undefined 926F 20 00 92 JSR &9200 .. \Copy memory absolute indexed 9272 A0 06 LDY #&06 00000110 \6 argument bytes 9274 A2 00 LDX #&00 00000000 \clear offset 9276 86 B7 STX &B7 .. \default to no indexing 9278 20 03 92 JSR &9203 .. \fetch operand byte 927B 95 B2 STA &B2,X .. \store in workspace 927D E8 INX . \increment offset 927E 88 DEY . \decrement counter 927F D0 F7 BNE &9278 .. \loop while more argument bytes 9281 A5 B7 LDA &B7 .. \get indexing argument 9283 4A LSR A J \move bits 7..4 to 3..0 9284 4A LSR A J 9285 4A LSR A J 9286 4A LSR A J 9287 20 AD 92 JSR &92AD .. \fetch relevant index value 928A 65 B2 ADC &B2 e. \add to From address 928C 85 B2 STA &B2 .. \store back in workspace 928E 90 02 BCC &9292 .. \if carry out occurs 9290 E6 B3 INC &B3 .. \then increment high byte. 9292 A5 B7 LDA &B7 .. \get indexing argument 9294 29 03 AND #&03 00000011 \mask off From bits 9296 20 AD 92 JSR &92AD .. \interpret To bits 9299 65 B4 ADC &B4 e. \add relevant index to To addres 929B 85 B4 STA &B4 .. \store back in workspace 929D 90 02 BCC &92A1 .. \if carry out occurs 929F E6 B5 INC &B5 .. \then increment high byte. 92A1 A0 00 LDY #&00 00000000 \clear offset 92A3 B1 B2 LDA (&B2),Y .. \fetch byte from From area 92A5 91 B4 STA (&B4),Y .. \store in To area 92A7 C8 INY . \increment offset 92A8 C4 B6 CPY &B6 .. \have we copied all bytes? 92AA 90 F7 BCC &92A3 .. \if not then loop 92AC 60 RTS ` \else exit. 92AD A8 TAY . \Interpret index bits. 92AE F0 08 BEQ &92B8 .. \if none set then return zero 92B0 BA TSX . \else put stack pointer in X 92B1 E8 INX . \add Y to X without using memory 92B2 88 DEY . 92B3 D0 FC BNE &92B1 .. 92B5 BD 04 01 LDA &0104,X ... \peek one of the saved registers 92B8 18 CLC . \clear carry for add and exit. 92B9 60 RTS ` \Parsing and validation 9300 4C 21 93 JMP &9321 L!. \Get drive spec 9303 4C 4A 93 JMP &934A LJ. \Get volume spec 9306 4C 34 93 JMP &9334 L4. \Get ambiguous volume spec 9309 4C 5B 93 JMP &935B L[. \Get path spec 930C 4C 53 93 JMP &9353 LS. \Get ambiguous path spec 930F 4C 77 93 JMP &9377 Lw. \Get entry (dir+file) name 9312 4C 96 93 JMP &9396 L.. \Get file spec 9315 4C 8E 93 JMP &938E L.. \Get ambiguous file spec 9318 4C 2B 94 JMP &942B L+. \Get multiple drive spec 931B 4C 53 94 JMP &9453 LS. \X=6, check volume letter 931E 4C 5E 94 JMP &945E L^. \Get space padded string char 9321 20 00 92 JSR &9200 .. \Get drive spec 9324 20 06 92 JSR &9206 .. \0, :1, :2, 3, (nothing) 9327 09 10 ORA #&10 00010000 \copy default to immediate drive 9329 C9 00 CMP #&00 00000000 932B 01 A2 ORA (&A2,X) .. \LDX #&00 as it's a "drive" spec 932D 00 BRK . 932E 20 6F 94 JSR &946F o. \get drive spec pt2 and finish. 9331 4C CF 93 JMP &93CF L.. 9334 20 00 92 JSR &9200 .. \Get ambiguous volume spec 9337 20 98 94 JSR &9498 .. \0, :2, :1A, 3H, 1* etc. 933A B0 0B BCS &9347 .. \get volume spec pt2 933C C9 2A CMP #&2A 00101010 \if EOWord finish else compare 933E D0 07 BNE &9347 .. \if this char <> "*" then finish 9340 A9 00 LDA #&00 00000000 \else immed vol = NUL ambiguous 9342 85 C8 STA &C8 .. 9344 20 C5 FF JSR &FFC5 .. \call GSREAD and finish. 9347 4C CF 93 JMP &93CF L.. 934A 20 00 92 JSR &9200 .. \Get volume spec 934D 20 98 94 JSR &9498 .. \0A,:2B etc. get vol pt2 &finish 9350 4C CF 93 JMP &93CF L.. 9353 20 00 92 JSR &9200 .. \Get ambiguous path spec 9356 A9 01 LDA #&01 00000001 \*, :0.*, :3A.*, etc. & as below 9358 4C 60 93 JMP &9360 L`. 935B 20 00 92 JSR &9200 .. \Get path spec 935E A9 00 LDA #&00 00000000 \$, D, :0, :3.M, :2B.$, 9360 85 CE STA &CE .. \:1A etc. 9362 20 06 92 JSR &9206 .. \copy default path to immediate 9365 07 ??? . 9366 10 C7 BPL &932F .. 9368 00 BRK . 9369 03 ??? . 936A A2 0D LDX #&0D 00001101 \this is a "directory" spec 936C 20 AB 94 JSR &94AB .. \get volume part of path spec 936F B0 03 BCS &9374 .. \if end-of-word then exit C=1. 9371 20 F0 94 JSR &94F0 .. \get directory letter & finish. 9374 4C CF 93 JMP &93CF L.. 9377 20 00 92 JSR &9200 .. \Get entry (dir+file) name 937A A9 00 LDA #&00 00000000 \PROG, $.!BOOT, M.DTX 937C 85 CE STA &CE .. \ambiguous specs not allowed 937E 20 06 92 JSR &9206 .. \copy default to immediate 9381 00 BRK . \filename + directory 9382 10 C0 BPL &9344 .. 9384 00 BRK . 9385 08 PHP . 9386 A2 17 LDX #&17 00010111 \this is an "entry" spec 9388 20 47 95 JSR &9547 G. \set up and jump into file spec 938B 4C AA 93 JMP &93AA L.. 938E 20 00 92 JSR &9200 .. \Get ambiguous file spec 9391 A9 01 LDA #&01 00000001 \INTRO, #####P, :2A.*.*, 9393 4C 9B 93 JMP &939B L.. \(nothing) 9396 20 00 92 JSR &9200 .. \Get file spec 9399 A9 00 LDA #&00 00000000 \KEYBD, B.DOTTY, :3.!BOOT, 939B 85 CE STA &CE .. \:2.$.LUNARLA, :A.DEBUG, 939D 20 06 92 JSR &9206 .. \:A.M.DEMO, :1G.DATA12, 93A0 00 BRK . \:0A.$.MENU, (nothing) 93A1 10 C0 BPL &9363 .. \store ambiguous flag 93A3 00 BRK . \copy default to immediate 93A4 0A ASL A . \filename and full path 93A5 A2 1D LDX #&1D 00011101 \this is a "file" spec 93A7 20 AB 94 JSR &94AB .. \get volume part of path spec 93AA B0 23 BCS &93CF .# \if end-of-word then exit C=1 93AC 20 1B 95 JSR &951B .. \else peek next char (AY presvd) 93AF D0 0C BNE &93BD .. \if it was <>".", get filename 93B1 20 F0 94 JSR &94F0 .. \else get directory letter 93B4 C9 2E CMP #&2E 00101110 \compare current char with "." 93B6 D0 1F BNE &93D7 .. \if unequal then "Bad spec" err 93B8 20 C5 FF JSR &FFC5 .. \else call GSREAD 93BB B0 12 BCS &93CF .. \if end-of-word then finish 93BD 20 FA 94 JSR &94FA .. \else get filename proper 93C0 90 0D BCC &93CF .. \if invalid then finish, else: 93C2 A5 CE LDA &CE .. \Accept filename 93C4 30 08 BMI &93CE 0. \if this spec is unambiguous 93C6 20 06 92 JSR &9206 .. \then copy immediate filename 93C9 C0 00 CPY #&00 00000000 \to default filename. 93CB 00 BRK . 93CC 10 07 BPL &93D5 .. 93CE 38 SEC 8 \C=1 for success, fall through: 93CF 90 06 BCC &93D7 .. \Finish parsing. 93D1 BA TSX . \if carry flag is set 93D2 98 TYA . \then return Y to caller 93D3 9D 03 01 STA &0103,X ... \and exit, else: 93D6 60 RTS ` 93D7 20 18 90 JSR &9018 .. \Give bad spec error 93DA 08 PHP . \start error "Bad " 93DB CC 42 61 CPY &6142 .Ba 93DE 64 ??? d 93DF 20 00 A5 JSR &A500 .. \LDA &CE if unambiguous spec 93E2 CE F0 0F DEC &0FF0 ... \BEQ &93F4 then skip 93E5 20 18 90 JSR &9018 .. \else add "ambiguous " 93E8 00 BRK . 93E9 61 6D ADC (&6D,X) am 93EB 62 ??? b 93EC 69 67 ADC #&67 01100111 93EE 75 6F ADC &6F,X uo 93F0 75 73 ADC &73,X us 93F2 20 00 BD JSR &BD00 .. \LDA &9409,X 93F5 09 94 ORA #&94 10010100 \append type of spec 93F7 F0 06 BEQ &93FF .. \to error. if NUL, finish 93F9 20 00 90 JSR &9000 .. \else 'print' character 93FC E8 INX . \increment offset and loop. 93FD D0 F5 BNE &93F4 .. 93FF 20 18 90 JSR &9018 .. \finish error with " spec". 9402 02 ??? . 9403 20 73 70 JSR &7073 sp 9406 65 63 ADC &63 ec 9408 00 BRK . 9409 64 ??? d \spec types: &00,"drive" 940A 72 ??? r 940B 69 76 ADC #&76 01110110 940D 65 00 ADC &00 e. 940F 76 6F ROR &6F,X vo \&06,"volume" 9411 6C 75 6D JMP (&6D75) lum 9414 65 00 ADC &00 e. 9416 64 ??? d \&0D,"directory" 9417 69 72 ADC #&72 01110010 9419 65 63 ADC &63 ec 941B 74 ??? t 941C 6F ??? o 941D 72 ??? r 941E 79 00 65 ADC &6500,Y y.e \&17,"entry" 9421 6E 74 72 ROR &7274 ntr 9424 79 00 66 ADC &6600,Y y.f \&1D,"file" 9427 69 6C ADC #&6C 01101100 9429 65 00 ADC &00 e. 942B 20 00 92 JSR &9200 .. \Get multiple drive spec 942E A2 00 LDX #&00 00000000 \(nothing), 0, :2, :1 2, 1 :3 9430 20 47 95 JSR &9547 G. \call GSINIT C=0 then GSREAD 9433 B0 1B BCS &9450 .. \if end-of-word then finish 9435 C9 3A CMP #&3A 00111010 \else compare this char with ":" 9437 D0 06 BNE &943F .. \if unequal try it as drive no. 9439 20 7C 94 JSR &947C |. \else get drive character 943C 4C 47 94 JMP &9447 LG. \and loop if EOW else bad spec. 943F 20 8A 94 JSR &948A .. \validate and store drive number 9442 90 08 BCC &944C .. \if invalid return in A 9444 20 C5 FF JSR &FFC5 .. \else call GSREAD 9447 B0 E7 BCS &9430 .. \if end-of-word then loop 9449 4C D7 93 JMP &93D7 L.. \else give "Bad spec" error. 944C BA TSX . \Return A to caller 944D 9D 05 01 STA &0105,X ... \and finish parsing. 9450 4C D1 93 JMP &93D1 L.. 9453 20 00 92 JSR &9200 .. \X=6, check volume letter 9456 A2 06 LDX #&06 00000110 \this is a "volume" spec 9458 20 D8 94 JSR &94D8 .. \validate volume letter 945B 4C CF 93 JMP &93CF L.. \or error if invalid. 945E 24 E4 BIT &E4 $. \Get space padded string char 9460 70 09 BVS &946B p. \if b6 of MOS workspace flag set 9462 20 C5 FF JSR &FFC5 .. \(volatile?) then exit else GSRD 9465 90 07 BCC &946E .. \if not EOS return character C=0 9467 66 E4 ROR &E4 f. \else set b6 of workspace flag 9469 66 E4 ROR &E4 f. 946B A9 20 LDA #&20 00100000 \return a space 946D 38 SEC 8 \and exit C=1 (end-of-string) 946E 60 RTS ` 946F A9 00 LDA #&00 00000000 \Get drive spec pt2 9471 85 CE STA &CE .. \ambiguous spec not allowed 9473 20 47 95 JSR &9547 G. \call GSINIT C=0 then GSREAD 9476 B0 11 BCS &9489 .. \if end-of-word then exit C=1 9478 C9 3A CMP #&3A 00111010 \else compare with ":" 947A D0 05 BNE &9481 .. \if unequal try as drive number 947C 20 C5 FF JSR &FFC5 .. \else call GSREAD 947F B0 08 BCS &9489 .. \if end-of-word exit C=1, else: 9481 20 8A 94 JSR &948A .. \Get drive character 9484 90 03 BCC &9489 .. \test&store, if invalid exit C=0 9486 20 C5 FF JSR &FFC5 .. \else call GSREAD and exit. 9489 60 RTS ` 948A C9 30 CMP #&30 00110000 \Validate and store drive number 948C 90 08 BCC &9496 .. \if less than ASCII "0" 948E C9 34 CMP #&34 00110100 \or greater than "3" 9490 B0 04 BCS &9496 .. \then exit C=0 9492 85 C9 STA &C9 .. \else store immediate drive 9494 38 SEC 8 \and exit C=1. 9495 60 RTS ` 9496 18 CLC . 9497 60 RTS ` 9498 20 06 92 JSR &9206 .. \Get volume spec pt2 949B 08 PHP . \copy default to immediate 949C 10 C8 BPL &9466 .. \volume letter and drive number 949E 00 BRK . 949F 02 ??? . 94A0 A2 06 LDX #&06 00000110 \this is a "volume" spec 94A2 20 6F 94 JSR &946F o. \get drive spec pt2 94A5 B0 03 BCS &94AA .. \if end-of-word exit C=1 94A7 20 CF 94 JSR &94CF .. \else get volume letter & exit. 94AA 60 RTS ` 94AB 20 47 95 JSR &9547 G. \Get volume part of path spec 94AE B0 1E BCS &94CE .. \call GSINIT C=0 then GSREAD 94B0 C9 3A CMP #&3A 00111010 \if EOW exit C=1 else compare 94B2 D0 19 BNE &94CD .. \if this char <> ":" exit C=0 94B4 20 C5 FF JSR &FFC5 .. \else call GSREAD 94B7 B0 15 BCS &94CE .. \if end-of-word exit C=1 94B9 20 81 94 JSR &9481 .. \else get drive character 94BC B0 10 BCS &94CE .. \if end-of-word exit C=1 94BE 20 CF 94 JSR &94CF .. \else get volume letter 94C1 B0 0B BCS &94CE .. \if end-of-word exit C=1 94C3 C9 2E CMP #&2E 00101110 \else compare this char to "." 94C5 F0 03 BEQ &94CA .. \if equal call GSREAD and exit 94C7 4C D7 93 JMP &93D7 L.. \else give "Bad spec" error. 94CA 4C C5 FF JMP &FFC5 L.. 94CD 18 CLC . 94CE 60 RTS ` 94CF 20 D8 94 JSR &94D8 .. \Get volume letter 94D2 90 03 BCC &94D7 .. \test&store, if invalid exit C=0 94D4 20 C5 FF JSR &FFC5 .. \else call GSREAD and exit. 94D7 60 RTS ` 94D8 C9 41 CMP #&41 01000001 \Validate & store volume letter 94DA 90 12 BCC &94EE .. \if less than "A" exit C=0 94DC C9 49 CMP #&49 01001001 \else if "H" or less 94DE 90 0A BCC &94EA .. \then store and exit C=1 94E0 C9 61 CMP #&61 01100001 \else if less than "a" 94E2 90 0A BCC &94EE .. \then exit C=0 94E4 C9 69 CMP #&69 01101001 \else if greater than "i" 94E6 B0 06 BCS &94EE .. \then exit C=0 94E8 29 DF AND #&DF 11011111 \else convert to uppercase 94EA 85 C8 STA &C8 .. \store immediate volume 94EC 38 SEC 8 \and exit C=1. 94ED 60 RTS ` 94EE 18 CLC . 94EF 60 RTS ` 94F0 20 24 95 JSR &9524 $. \Get directory letter 94F3 90 D2 BCC &94C7 .. \test spec char, error if bad 94F5 85 C7 STA &C7 .. \else store immediate directory 94F7 4C C5 FF JMP &FFC5 L.. \call GSREAD and exit. 94FA 20 00 92 JSR &9200 .. \Get filename proper 94FD A2 00 LDX #&00 00000000 \x is now just an offset 94FF 20 24 95 JSR &9524 $. \test spec character 9502 90 14 BCC &9518 .. \if invalid return Y, exit C=0 9504 95 C0 STA &C0,X .. \else store immediate filename 9506 E8 INX . \increment offset 9507 E0 07 CPX #&07 00000111 \have we taken 7 characters? 9509 F0 0A BEQ &9515 .. \if so get pad char and finish 950B C9 2A CMP #&2A 00101010 \else compare this char with "*" 950D F0 03 BEQ &9512 .. \if unequal, then: 950F 20 1E 93 JSR &931E .. \get space padded character. 9512 4C FF 94 JMP &94FF L.. \now loop for more characters. 9515 20 1E 93 JSR &931