home *** CD-ROM | disk | FTP | other *** search
- DOSSEG
- .MODEL medium
-
- PUBLIC _SecVer
-
- ;========================================================
- ; Verify sectors. The usage is:
- ;
- ; push <drive> ;drive number
- ; push <head> ;head (side) number
- ; push <track> ;track number
- ; push <sector> ;sectors number
- ; push <count> ;number of sectors to verify
- ; call _SecVer ;verify
- ;
- ; The values are not checked. AX = 0 if no errors,
- ; otherwise the disk status is returned in AL and
- ; AH = 0.
- ;
- ; The stack is cleared on exit and all registers are
- ; preserved except AX.
-
- SecVerStk STRUC
- registers dw 6 DUP (?)
- retaddr dw 2 DUP (?)
- count dw ?
- sector dw ?
- track dw ?
- head dw ?
- drive dw ?
- SecVerStk ENDS
-
- ASSUME ds:NOTHING, es:NOTHING, ss:NOTHING
-
- .CODE
-
- _SecVer PROC
- push cx
- push dx
- push di
- push si
- push bp
- push es
- mov bp, sp
-
- ;--- verify the sectors
-
- mov al, byte ptr [bp].count ;sector count
- mov ch, byte ptr [bp].track ;track number
- mov cl, byte ptr [bp].sector ;sector number
- mov dh, byte ptr [bp].head ;head number
- mov dl, byte ptr [bp].drive ;drive number
-
- mov ah, 4 ;verify function
- int 13h ;execute
- jnc Scvr1
-
- ;--- error, reset disk and try again
-
- mov ah, 0 ;reset function
- int 13h ;execute
-
- mov ah, 4 ;verify function
- int 13h ;execute
- jnc ScVr1 ;jump if okay
-
- ;--- error formatting track
-
- mov al, ah
- sub ah, ah
- jmp ScVr2
-
- ;--- sector is verified
-
- Scvr1: sub ax, ax
-
- Scvr2: pop es
- pop bp
- pop si
- pop di
- pop dx
- pop cx
- ret 10
- _SecVer ENDP
-
- END
-