8-Bit Software Online Conversion
:2.S.CD - Listing
10 REM CD <d1> <d2>
20 FORI%=0 TO 2 STEP 2
30 P%=&900
40 [OPTI%
50 .cd
60 LDY #0
70 .findend
80 LDA(&F2),Y:INY:CMP#13:BEQhelp:CMP#
32:BNE findend:BEQ findd1
90 .help
100 JSR print
110 EQUB10
120 EQUS"DFS file DIRECTORY CHANGER "
122 EQUW&0A0D
130 EQUB10
140 EQUS"*CD <old d> <new d>"
150 EQUW&0A0D
160 EQUB10
170 EQUS"<old d> may be * "
180 EQUW&0A0D
182 EQUS"all files will then goto <new
d>"
184 EQUW&0A0D
190 EQUW &000A
200 RTS
210 .findd1
220 LDA(&F2),Y:CMP #32:BNE gck1
230 .skip1
240 INY:LDA(&F2),Y:CMP #32:BEQ skip1
250 .gck1
260 CMP#13:BNE clrbuf1:JMP help
262 .clrbuf1
270 LDA #32:LDX #16
280 .clr1
290 DEX:STA buffer,X:BNE clr1
300 .getd1
310 LDA (&F2),Y:STA buffer,X
312 INY:INX
314 CMP #13:BEQ fault
316 CMP #32:BNE getd1:BEQ findd2
320 .fault
330 BRK:EQUB 128
332 EQUS "new directory ????"
334 EQUB 0
340 .findd2
350 LDA(&F2),Y:CMP #32:BNE gck2
360 .skip2
370 INY:LDA (&F2),Y:CMP #32:BEQ skip2
380 .gck2
390 CMP#13:BEQ fault
400 LDA #32:LDX #16
410 .clr2
420 DEX:STA buffer2,X:BNE clr2
430 .getd2
440 LDA (&F2),Y:STA buffer2,X
442 INY:INX
444 CMP #13:BEQ clrblks
446 CMP #32:BNE getd2
447 .clrblks
448 LDA #0:LDX #36
449 .clr3
450 DEX:STA block,X:BNE clr3
455 ½ get current drive No.
460 LDX #1
470 LDA #block2 AND &FF:STA block,X
480 INX
490 LDA #block2 DIV 256:STA block,X
500 LDX #block AND &FF:LDY #block DIV
256
510 LDA #5:JSR &FFD1
512 ½ read directory
520 LDX #14:LDA block2,X:STA block
530 LDX #1:LDA #0:STA block,X
540 INX:LDA #&0E:STA block,X
550 INX:INX
560 INX:LDA #3:STA block,X
570 INX:LDA #&53:STA block,X
580 INX:INX
590 INX:LDA #&21:STA block,X
600 LDX #block AND &FF:LDY #block DIV
256
610 LDA #&7F:JSR &FFF1
620
622 ½ perform FNCD
630 LDX #31:LDY #7
640 .loop
650 TYA:CLC:ADC #8:TAY
660 LDA buffer:CMP #ASC("*"):BEQ alter
670 CMP &E00,Y:BNE ck
680 .alter
690 LDA buffer2:STA &E00,Y
700 .ck
710 DEX:BNE loop
712 ½ write directory
720 LDX #6:LDA #&4B:STA block,X
730 LDX #block AND &FF:LDY #block DIV
256
740 LDA #&7F:JSR &FFF1
750 RTS ½ Return to basic
760 .print
770 JSR &FFE7:LDY #0:PLA:STA pr1+2:PLA
:STA pr1+3
780 .pr1
790 INY:LDA &FFFF,Y ½DUMMY
800 JSR &FFE3:BNE pr1
810 TYA:CLC:ADC pr1+2:TAX:BCC pr2:INC
pr1+3
820 .pr2
830 LDA pr1+3:PHA:TXA:PHA:RTS
840 .buffer EQUS "XXXXXXXXXXXXXXXX":EQ
UB13
850 .buffer2 EQUS "XXXXXXXXXXXXXXXX":E
QUB13
860 .block EQUW 0
870 EQUD 0
880 EQUD 0
890 EQUD 0
900 EQUD 0
910 .block2 EQUW 0
920 EQUD 0
930 EQUD 0
940 EQUD 0
950 EQUD 0
970 ]
980 NEXT
990 REM OSCLI"*SAVE CD "+STR$÷cd+" "+S
TR$÷P%