Mail Archives: djgpp/2000/05/02/17:14:19
At 13:46 02.05.2000 GMT, you wrote
--------> This was the original Message:
> if exist f:\michelle.2nd goto OK_2nd_drive_is_there
>
> rem handle the problem, here
> rem (may be impossible to handle, in which case you'll have to
> rem throw an error message and refuse to go on)
>
> :OK_2nd_drive_is_there
Hi Hans-Bernhard,
I have done this already...
It give me a system error
A(bbrechen) W(iederholen) U(ebergehen)
And then I hab´ve found this on a Web-Site:
*Registers used: (F)loppy (H)ard drive
AL - number of sectors to verify
AH - (04h) service number for interrupt 13h
CH - cylinder number (F)
low-order 8 bits of cylinder number (H)
CL - sector number (F)
high-order 2 bits of cylinder number,
plus 6 bit sector number (H)
DL - drive number
0 - A:, 1 - B:, 80h - first hard drive (C:)
DH - head number
BX - not used for verifying sectors
On return, if carry flag then error.
*Using in a .bat file
You can use this in a batch file.
Chkdsk returns a 0 in DOS' ERRORLEVEL if disk ready
Chkdsk returns a 1 in DOS' ERRORLEVEL if disk NOT ready
Example:
Chkdsk
@if ErrorLevel == 1 goto error
.
.do normal disk operation
.
goto end
:error
.
.do what ever error handling wanted
.
:end
Assemble with NBASM 00.23.xx
.MODEL tiny
.CODE
org 100h
mov ah,04h ; Verify Disk Sectors
mov al,01h ; Amount to verify
mov ch,01h ; High order cylinder number (8 bits)
mov cl,01h ; Sector Number in bits 0-5
xor dl,dl ; use drive A:
xor dh,dh ; remaining 6-7 bits are low order for CH
int 13h ; DH is the head number
xor al,al ; DOS' ERRORLEVEL
jnc Done ;
mov dl,07h ; simple beep
mov ah,02h ;
int 21h ;
mov al,01h ; DOS' ERRORLEVEL
Done: mov ah,4Ch ; exit to DOS
int 21h ;
.end ; End of assembly code
But I stand on my line and I do not know, how to use it...
Michelle
--
Don't cc: me on mailinglists, I'm subscribed, if I write there.
----------------------------------------------------------------------------
Linux rebootet man in drei Fällen:
Neuer Kernel, neue (Board-)Hardware, Stromausfall....
Aber Windows rebootet man auch in drei Fällen:
Schutzverletzung, Bluescreen, keinen Bock...
- Raw text -