10
20
30 DIM X% 31,data% 511:Y%=X%DIV256:*DISK
40 ON ERROR REPORT:PRINT " at line ";ERL:OSCLI"FX180,"+STR$(PAGE/256):END
50 *FX180,64
60 INPUT"Drive: "drive%
70 INPUT"Tracks: "num%
80 FOR track%=0 TO num%-1
90 PRINT CHR$13;"Track ";track%;
100 FOR sector%=0 TO 9
110 data%!(sector%*4)=track%
120 data%?(sector%*4+2)=(sector%+track%*7)MOD10
130 data%?(sector%*4+3)=1
140 NEXT sector%
150 X%?0=drive%
160 X%!1=data%
170 X%!5=&6305
180 X%?7=track%
190 X%!8=&10002A10
200 A%=127:REPEAT:CALL&FFF1:UNTIL X%?12<>&10
210 IF X%?12:PRINT" error &";~X%?12
220 NEXT track%:PRINT
230 FOR A%=0 TO 511 STEP 4:data%!A%=0:NEXT A%
240 data%?&107=num%*10
250 data%?&106=num%/25.6
260 X%?0=drive%
270 X%!1=data%
280 X%!5=&4B03
290 X%!9=&22
300 A%=127:REPEAT:CALL&FFF1:UNTIL X%?10<>&10
310 IF X%?10:PRINT"write error &";~X%?10
320 OSCLI"FX180,"+STR$(PAGE/256):END