10
20
30
40 :
50
60 PROCwp_Init
70 :
80
90 test%=(USR wpTest%) AND 255
100 IF test%=0 PRINT "Filing system writable"
110 IF test%:REPORT:PRINT " - error ";test%
120 END
130 :
140 :
150
160 DEFPROCwp_Init
170 OSBYTE=&FFF4:OSGBPB=&FFD1:BRKV=&202
180 DIM wpTest% 83
190 FOR A%=0 TO 1:P%=wpTest%:[OPT A%*2
200 TSX:STX Stack:JSR SwapBRK
210 LDA #&0D:STA &101
220 LDY #&01:STY &102
230 LDX #&00:STX &103:STX &104
240 LDA #5:JSR OSGBPB
250 LDX &10D:LDA &10E,X:AND #3
260 TAY:LDX #4:LDA #&8B:JSR OSBYTE
270 LDA #0:BEQ SwapBRK
280 .Error
290 LDX Stack:TXS
300 LDY #0:LDA (&FD),Y
310 .SwapBRK
320 PHA:LDY #1
330 .SwapBRKlp
340 LDA BRKV,Y:LDX Catch,Y
350 STA Catch,Y:TXA:STA BRKV,Y
360 DEY:BPL SwapBRKlp:PLA:RTS
370 .Catch:EQUW Error
380 .Stack:EQUB 0
390 ]NEXT:ENDPROC
400 :