8-Bit Software Online Conversion
ADFS directory wipe - Listing
10REM DirWipe <dir>
20MODE7
30PROCvars
40PROCass
50PROCsave
60END
70
80DEFPROCvars
90oswrch%=&FFEE:osasci%=&FFE3
100osfile%=&FFDD:osgbpb%=&FFD1
110osargs%=&FFDA:osrdch%=&FFE0
120oscli%=&FFF7:osnewl%=&FFE7
130work%=&86:argblk%=&88:indptr%=&8C
140indptr2%=&8E:temp%=&C00:temp2%=&C80
150version$="1.00"
160ENDPROC
170
180DEFPROCass
190DIM code% &400
200FOR pass%=4 TO 6 STEP 2
210P%=&900:O%=code%
220[OPT pass%
230LDA#1:LDX#argblk%:LDY#0:JSRosargs%
240LDX#(temp2%+5)MOD256:STXtemp2%+1
250LDY#(temp2%+5)DIV256:STYtemp2%+2
260LDX#temp2%MOD256:LDY#temp2%DIV256:L
DA#6:JSRosgbpb%
270LDAtemp2%+7:TAY:LDA#&D:INY:STAtemp2
%+7,Y
280LDX#nametext%MOD256:LDY#nametext%DI
V256:JSRptext%:JSRosnewl%
290LDX#ctext%MOD256:LDY#ctext%DIV256:J
SRptext%:JSRosnewl%:JSRosnewl%
300LDA#dirtext%MOD256:STAindptr%
310LDA#dirtext%DIV256:STAindptr%+1
320LDX#temp%MOD256:LDY#temp%DIV256:JSR
copytext%
330LDAargblk%:STAindptr%
340LDAargblk%+1:STAindptr%+1
350LDX indptr2%:LDY indptr2%+1
360JSRcopytext%
370LDA#&D:STA(indptr2%),Y
380LDX#temp%MOD256:LDY#temp%DIV256
390JSRoscli%
400½ **** OK UP TO HERE ****
410
420LDA#space%MOD256:STAwork%
430LDA#space%DIV256:STAwork%+1
440JSRrec`del%
450LDA#dirtext%MOD256:STAindptr%
460LDA#dirtext%DIV256:STAindptr%+1
470LDX#temp%MOD256:LDY#temp%DIV256:JSR
copytext%
480LDX#(temp2%+8)MOD256:STXindptr%
490LDA#(temp2%+8)DIV256:STAindptr%+1
500LDXindptr2%:LDYindptr2%+1:JSRcopyte
xt%
510LDX#temp%MOD256:LDY#temp%DIV256:JSR
oscli%
520LDX#deltext%MOD256:LDY#deltext%DIV2
56:JSRptext%
530LDXargblk%:LDYargblk%+1:JSRptext%:J
SRosnewl%
540LDXargblk%:STXtemp%:LDYargblk%+1
550STYtemp%+1:LDX#temp%MOD256
560LDY#temp%DIV256:LDA#3:STAtemp%+&E
570LDA#4:JSRosfile%:LDA#6:JMPosfile%
580
590.rec`del%
600PHP:PHA:TXA:PHA:TYA:PHA
610LDY#0:TYA:.blankloop%
620STA (work%),Y:INY:CPY#25
630BNE blankloop%
640
650.readnext% LDY#1
660LDAwork%:CLC:ADC#13:STA(work%),Y:ST
Aindptr%
670INY:LDAwork%+1:ADC#0:STA(work%),Y:S
TAindptr%+1
680INY:INY:INY:LDA#1:STA(work%),Y:INY:
INY:INY:INY:LDA#0:STA(work%),Y
690LDX work%:LDY work%+1:LDA#8
700JSRosgbpb%:BCC gettype%:JMP lastfil
e%
710
720.gettype%
730LDY#0:LDA(indptr%),Y:TAY:LDA#&D:INY
:STA(indptr%),Y
740LDAindptr%:STAtemp%:LDAindptr%+1:ST
Atemp%+1
750INCtemp%:BNEgtover1%:INCtemp%+1:.gt
over1%
760LDA#5:LDX#temp%MOD256:LDY#temp%DIV2
56:JSRosfile%
770CMP#2:BNE deleteit%
780
790LDAtemp%:STAindptr%
800LDAtemp%+1:STAindptr%+1
810LDX#(temp%+4)MOD256:LDY#(temp%+4)DI
V256
820JSRcopytext%
830LDY#0:LDA#&D:STA(indptr2%),Y
840LDA#dirtext%MOD256:STAindptr%
850LDA#dirtext%DIV256:STAindptr%+1
860LDX#temp%MOD256:LDY#temp%DIV256
870JSRcopytext%
880LDX#temp%MOD256:LDY#temp%DIV256:JSR
oscli%
890
900LDA work%:PHA:LDA work%+1:PHA
910LDA work%:CLC:ADC#25:STA work%
920LDA work%+1:ADC#0:STA work%+1
930JSR rec`del%
940PLA:STAwork%+1:PLA:STAwork%
950LDA#dirtext%MOD256:STAindptr%
960LDA#dirtext%DIV256:STAindptr%+1
970LDX#temp%MOD256:LDY#temp%DIV256
980JSRcopytext%
990LDY#0:LDA#ASC"^":STA(indptr2%),Y
1000INY:LDA#&D:STA(indptr2%),Y
1010LDX#temp%MOD256:LDY#temp%DIV256:JSR
oscli%
1020
1030.deleteit%
1040LDAwork%:CLC:ADC#14:STAtemp%
1050LDAwork%+1:ADC#0:STAtemp%+1
1060LDX#deltext%MOD256:LDY#deltext%DIV2
56:JSRptext%
1070LDXtemp%:LDYtemp%+1:JSRptext%:JSRos
newl%
1080LDA#3:STAtemp%+&E:LDX#temp%MOD256
1090LDY#temp%DIV256:LDA#4:JSRosfile%
1100
1110LDA#6:JSRosfile% ½DELETE file
1120
1130JMP readnext%
1140
1150.lastfile%
1160PLA:TAY:PLA:TAX:PLA:PLP
1170RTS
1180
1190.copytext%
1200STX indptr2%:STY indptr2%+1
1210LDY#0
1220.copyloop%
1230LDA (indptr%),Y:CMP#&D:BEQ clend%
1240STA (indptr2%),Y
1250INC indptr2%:BNE cl1% INCindptr2%+1
1260.cl1%
1270INC indptr%:BNE cl2%:INC indptr%+1
1280.cl2%
1290JMP copyloop%
1300.clend% RTS
1310
1320.ptext% STX indptr%:STY indptr%+1
1330LDY#0:.ptloop% LDA(indptr%),Y
1340CMP#&D:BEQ ptend%:JSRoswrch%
1350INY:JMP ptloop%
1360.ptend% LDY#0:RTS
1370
1380.dirtext% EQUS"DIR ":EQUB&D
1390.deltext% EQUS"Deleting ":EQUB&D
1400.nametext% EQUS"DirWipe "+version$:
EQUB&D
1410.ctext% EQUS"(C) Copyright HeadFirs
t PD/G Boden 1993":EQUB&D
1420
1430.space%
1440]
1450NEXT
1460ENDPROC
1470
1480DEFPROCsave
1490PRINT"Start address: &";÷code%
1500PRINT"End address: &";÷O%
1510OSCLI"Save DirWipe "+STR$÷code%+" "
+STR$÷O%+" 900 900"
1520ENDPROC