8-Bit Software Online Conversion
:2.$.DIRcode - Listing
10*| $ Directory replace source code
20*| (c) H.S.Williams 04/08/92
30*| Hi Daniel!
40FOR PASS%=0TO3 STEP3
50P%=&900
60[OPT PASS%
70.start
80LDA &FFF8
90STA &F8
100LDA &FFF9
110STA &F9
120LDY #0
130LDA (&F8),Y
140STA clioldvector+1
150INY
160LDA (&F8),Y
170STA clioldvector+2
180LDA #climain DIV &100
190STA (&F8),Y
200DEY
210LDA #climain MOD &100
220STA (&F8),Y
230RTS
240.climain
250STX &F8:STY &F9
260LDY #&FF
270.cliloop1
280INY:LDA (&F8),Y
290CMP #ASC("*"):BEQ cliloop1
300CMP #ASC(" "):BEQ cliloop1
310CMP #ASC("H"):BNE check
320INY:LDA (&F8),Y
330CMP #ASC("."):BNE clirep
340JMP helptext
350.check
360CMP #ASC("Z"):BNE clirep
370INY:LDA (&F8),Y
380CMP #ASC("L"):BEQ dlock
390CMP #ASC("C"):BEQ dchange
400CMP #ASC("A"):BEQ dactive
410CMP #ASC("I"):BEQ dinactive
420.clirep
430LDA dstatus:BEQ cliexit
440LDY #&FF:LDX #&FF
450.cliloop2
460INY:LDA (&F8),Y
470CMP #ASC("$"):BEQ replace
480INX:STA newtext,X
490CMP #&0D:BNE cliloop2
500JMP cliexit
510.replace
520TYA:PHA:LDY #&FF
530.reploop
540INY:LDA dirtext,Y:CMP #&0D:BEQ repo
ver
550INX:STA newtext,X:JMP reploop
560.repover
570PLA:TAY
580.finalloop
590INY:LDA (&F8),Y
600INX:STA newtext,X
610CMP #&0D:BNE finalloop
620LDA #newtext MOD &100
630STA &F8
640LDA #newtext DIV &100
650STA &F9
660.cliexit
670LDX &F8:LDY &F9
680.clioldvector
690JMP &FFFF
700.dlock
710LDX #&01
720.dlockloop
730INY:LDA (&F8),Y
740CMP #ASC(" "):BEQ dlockloop
750INX:STA dirtext,X
760CMP #&0D:BNE dlockloop
770LDA #1:STA dstatus:STA tstatus
780RTS
790.dchange
800LDA dstatus:EOR #1:STA dstatus:RTS
810.dactive
820LDA #1:STA dstatus:RTS
830.dinactive
840LDA #0:STA dstatus:RTS
850RTS
860.helptext
870LDA &F8:PHA:LDA &F9:PHA
880LDA #message MOD &100:STA &F8
890LDA #message DIV &100:STA &F9
900JSR printroutine
910LDA dstatus
920BNE help2
930LDA #inactive MOD &100:STA &F8
940LDA #inactive DIV &100:STA &F9
950JSR printroutine
960JMP strmess
970.help2
980LDA #active MOD &100:STA &F8
990LDA #active DIV &100:STA &F9
1000JSR printroutine
1010.strmess
1020LDA tstatus:BEQ nostr
1030LDA #string MOD &100:STA &F8
1040LDA #string DIV &100:STA &F9
1050JSR printroutine
1060LDA #dirtext MOD &100:STA &F8
1070LDA #dirtext DIV &100:STA &F9
1080JMP helpexit
1090.nostr
1100LDA #nostring MOD &100:STA &F8
1110LDA #nostring DIV &100:STA &F9
1120.helpexit
1130JSR printroutine
1140PLA:STA &F9:PLA:STA &F8
1150JMP cliexit
1160.printroutine
1170LDY #&FF
1180.printloop
1190INY:LDA (&F8),Y:JSR &FFE3
1200CMP #&0D:BNE printloop
1210RTS
1220.dstatus
1230EQUB 0
1240.tstatus
1250EQUB 0
1260.message
1270EQUS "Directory Lock (c) 1992 H.S.W
."
1280EQUB &0D
1290.active
1300EQUS " Active"
1310EQUB &0D
1320.inactive
1330EQUS " Inactive"
1340EQUB &0D
1350.string
1360EQUS " $. Directory replaced by :"
1370EQUB &0D
1380.nostring
1390EQUS " No replace string"
1400EQUB &0D
1410.dirtext
1420EQUS "$.(c) Hugh S Williams 1992"
1430EQUB &0D
1440.newtext
1450EQUS "Thanks to Daniel Shimmin and
Duncan Webster for putting up with me"
1460]:NEXT PASS%
1470*SAVE DIRlock 900 +200