[net.micro] Checking a floppy disk for blankness -- please move to net.micro.pc

6101778@PUCC.BITNET (Angus Christie) (09/27/86)

# ignore this message if you don't want to read it
 
In article <806@aluxs.UUCP>, cdl@aluxs.UUCP (MITCHELL) writes:
 
>... Does anyone know how to find out
>if a floppy diskette is blank/non-blank without using the 'dir' command.
>A source code on how to do this would be more than welcome.
 
Okay, you will have to dig your hands into the BIOS to solve this one.
BIOS call 13H allows you direct access to the floppy controller.  The
following code will do what you want:
 
    MOV AH,0 ; reset controller
    INT 13H
    MOV AX,401h ; verify one sector
    MOV CX,0001h ; at track 0/sector 1
    MOV DX,0     ; on drive A. (B=1, C=2, ...)
    INT 13H
  ; carry will be set if something funny happened. error code will be in AH.
 
Now, before everyone gets on my case, I would like to ask that any followups
be posted into net.micro.pc.