🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #268

Re: Is a floppy formatted ?

#268
From: Philip Smolen
Date: Thu, 06 Aug 1992 20:47
19 lines
1146 bytes
In article <1992Aug6.093943.196@mble.philips.be> stern@mble.philips.be writes:
>Could anybody explain me how to detect if a floppy is already formatted

Try this:

	mov	ax,0401h	;ah=4 -> verify    al=1 -> 1 sector
	mov	cx,1		;track=0 / sector=1
	mov	dx,0		;head=0 / drive=0, mov dx,1 for b:
	int	13h
	jc	not_formatted
formatted:

This will verify that the boot sector of the disk has been properly
formatted.  To be even more certain, check the first three bytes of this
sector.  They should be a short jump followed by a nop or a near jump
for an MSDOS format.  Be sure to try any bios disk operation on a
floppy at least three times before accepting an error condition.

				--Phil
Technical Details
Message-ID: <l833uiINN1i9@muleshoe.cs.utexas.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!sol.ctr.columbia.edu!usc!cs.utexas.edu!news
References: <1992Aug6.093943.196@mble.philips.be>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!destroyer!sol.ctr.columbia.edu!usc!cs.utexas.edu!news
From: phil@cs.utexas.edu (Philip Smolen)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Is a floppy formatted ?
Date: 6 Aug 1992 15:47:14 -0500
Organization: U Texas Dept of Computer Sciences, Austin TX
Lines: 19
Message-ID: <l833uiINN1i9@muleshoe.cs.utexas.edu>
References: <1992Aug6.093943.196@mble.philips.be>
NNTP-Posting-Host: muleshoe.cs.utexas.edu