8-Bit Software Online Conversion
:2.S.VERIFY - Listing
10 REM V <drive>
20 OSRDCH=&FFE0
30 OSASCI=&FFE3
40 OSWORD=&FFF1
60 DRIVE=&2F9F
70 TRACK=&2F9D
80 LOSIZE=&2FAB
90 HISIZE=&2FAC
100 TCOUNT=&2FAF
110 FORI%=0 TO 2 STEP 2
120 P%=&3200
130 [OPTI%
140 .verify
150 LDY #0
160 .findend
170 LDA(&F2),Y:INY:CMP#13:BEQhelp:CMP#
32:BNE findend:BEQ findd1
180 .help
190 JSR print
200 EQUB10
210 EQUS"DFS disk verifyer"
220 EQUW&0A0D
230 EQUB10
240 EQUS"*V <drive 0-3>"
250 EQUW&0A0D
260 EQUW&000A
270 RTS
280 .findd1
290 LDA(&F2),Y:CMP #32:BNE gck1
300 .skip1
310 INY:LDA(&F2),Y:CMP #32:BEQ skip1
320 .gck1
330 CMP#13:BEQ help
340 .clrbuf1
350 LDA #32:LDX #16
360 .clr1
370 DEX:STA buffer,X:BNE clr1
380 .getd1
390 LDA (&F2),Y:STA buffer,X
400 INY:INX
410 CMP #13:BEQ ok
420 CMP #32:BNE getd1:BEQ ok
430 .fault
440 BRK:EQUB 128
450 EQUS "Disc not formated !!!"
460 EQUB 0
470 .ok
480 JSR print
490 EQUB10
500 EQUS"Press any key when ready"
510 EQUW&0A0D
520 EQUW &000A
530 JSR OSRDCH
540 LDX #0
550 LDA buffer,X:SEC:SBC #48
570 STA DRIVE:STX TRACK:STX VERR+1
572 CMP #4:BMI START:JMP help
580 .START
590 JSR DIRCMD ½ Set cmd blk
600 LDA #&7F:LDX #&A0:LDY #&2F
610 JSR OSWORD
620 LDA &2FAA ½ Get error code
630 CMP #0:BEQ V1:JMP fault
640 .V1
650 LDA &3106 ½ Get hi disc size
660 AND #&03
670 CMP #&01:BEQ DS1
680 CMP #&03:BEQ DS2
690 JMP fault
700 .DS1
710 LDA #&28 ½ Set 40 track
720 STA TCOUNT:JMP DVER
730 .DS2
740 LDA #&50 ½ Set 80 track
750 STA TCOUNT
760 .DVER
770 JSR DCHAR
780 JSR VER ½ Set up verify
790 LDA #&7F:LDX #&90:LDY #&2F
800 JSR OSWORD
810 LDA &2F9A ½ Get error code
820 CMP #0:BEQ DV2:INC VERR+1
830 LDA #&3F:JSR OSASCI ½ PRINT"?"
840 LDA #&20:JSR OSASCI ½ PRINT" "
850 JMP DV3
860 .DV2
870 LDA #&20:JSR OSASCI:JSR OSASCI
880 .DV3
890 INC TRACK:LDA TRACK
900 CMP TCOUNT:BNE DVER
901 PHA:JSR &FFE7:PLA
902 CMP #&50:BNE t40
903 LDA #&38:JMP pt
904 .t40
905 LDA #&34
906 .pt
907 JSR OSASCI:LDA #&30:JSR OSASCI
910 JSR print
920 EQUS" track disc has "
930 EQUB0
932 .VERR
940 LDA #0:JSR DCHAR+3
950 JSR print
960 EQUS" errors "
970 EQUB0
1000 JSR &FFE7:JSR &FFE7
1010 RTS ½ Return to basic
1020
1030 .DIRCMD
1040 LDX #0:LDA DRIVE:STA &2FA0,X
1050 INX:LDA #&00:STA &2FA0,X
1060 INX:LDA #&31:STA &2FA0,X
1070 INX:LDA #&00:STA &2FA0,X
1080 INX:STA &2FA0,X
1090 INX:LDA #&03:STA &2FA0,X
1100 INX:LDA #&53:STA &2FA0,X
1110 INX:LDA #&00:STA &2FA0,X
1120 INX:LDA #&01:STA &2FA0,X
1130 INX:LDA #&21:STA &2FA0,X
1140 INX:LDA #&FF:STA &2FA0,X
1150 RTS
1160 .VER
1170 LDX #0:LDA DRIVE:STA &2F90,X
1180 INX:LDA #&00:STA &2F90,X
1190 INX:STA &2F90,X
1200 INX:STA &2F90,X
1210 INX:STA &2F90,X
1220 INX:LDA #&03:STA &2F90,X
1230 INX:LDA #&5F:STA &2F90,X
1240 INX:LDA TRACK:STA &2F90,X
1250 INX:LDA #&00:STA &2F90,X
1260 INX:LDA #&2A:STA &2F90,X
1270 INX:LDA #&FF:STA &2F90,X
1280 RTS
1290 .DCHAR
1300 LDA TRACK:TAY
1310 LDX #&FE
1320 ROR A:ROR A:ROR A:ROR A
1330 .CHAR2
1340 AND #&0F
1350 SEC:SBC #&0A:BCS TX1
1360 ADC #&3A:BCS TX2
1370 .TX1
1380 ADC #&40
1390 .TX2
1400 JSR OSASCI
1410 INX:BEQ TX3
1420 TYA:JMP CHAR2
1430 .TX3
1440 RTS
1450 .print
1460 LDY #0:PLA:STA pr1+2:PLA:STA pr1+3
1470 .pr1
1480 INY:LDA &FFFF,Y ½DUMMY
1490 JSR &FFE3:BNE pr1
1500 TYA:CLC:ADC pr1+2:TAX:BCC pr2:INC
pr1+3
1510 .pr2
1520 LDA pr1+3:PHA:TXA:PHA:RTS
1530 .buffer EQUS "XXXXXXXXXXXXXXXX":EQ
UB13
1540 .buffer2 EQUS "XXXXXXXXXXXXXXXX":E
QUB13
1550 ]
1560 NEXT
1570 REM OSCLI"*SAVE V "+STR$÷verify+"
"+STR$÷P%