10
20
30 :
40
50 PROCwp_Init
60 :
70
80 test%=(USR wpTest%) AND 255
90 IF test%=0 PRINT "Filing system writable"
100 IF test%:REPORT:PRINT " - error ";test%
110 END
120 :
130 :
140
150 DEFPROCwp_Init
160 OSBYTE=&FFF4:OSGBPB=&FFD1:BRKV=&202
170 DIM wpTest% 113
180 FOR A%=0 TO 1:P%=wpTest%:[OPT A%*2
190 TSX:STX Stack:JSR SwapBRK
200 LDA #Buffer AND 255:STA Ctrl+1
210 LDA #Buffer DIV 256:STA Ctrl+2
220 LDX #Ctrl AND 255
230 LDY #Ctrl DIV 256
240 LDA #5:JSR OSGBPB
250 LDX Buffer:LDA Buffer+1,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 .Ctrl:EQUB 0:EQUD Buffer:EQUD 0:EQUD 0
400 .Buffer:EQUS STRING$(20," ")
410 ]NEXT:ENDPROC
420 :