home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / msdos / programm / 8510 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  930 b 

  1. Path: sparky!uunet!cs.utexas.edu!news
  2. From: phil@cs.utexas.edu (Philip Smolen)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: Detecting a disk in floppy drive
  5. Date: 13 Aug 1992 03:26:47 -0500
  6. Organization: U Texas Dept of Computer Sciences, Austin TX
  7. Lines: 21
  8. Message-ID: <l8k767INNgf8@muleshoe.cs.utexas.edu>
  9. References: <4672@blue.cis.pitt.edu.UUCP>
  10. NNTP-Posting-Host: muleshoe.cs.utexas.edu
  11.  
  12. In article <4672@blue.cis.pitt.edu.UUCP> demented+@pitt.edu (Scott E Berry) writes:
  13. >
  14. >How can I detect if a drive contains a disk without getting the 
  15. >Abort, Retry, Ignore message.  I work in a computer lab at Pitt
  16.  
  17. Use int 13h to "verify" the first sector on the disk.  For example:
  18.  
  19. a_drive    equ    0
  20. b_drive    equ    1
  21. tries    equ    3
  22.  
  23.     mov    si,tries
  24. verify:    mov    ax,0401h    ; verify 1 sector
  25.     mov    cx,1        ; sector == 1; cylinder== 0
  26.     mov    dx,a_drive    ; head == 0; drive == a:
  27.     int    13h
  28.     jnc    disk_is_in_drive
  29.     dec    si
  30.     jnz    verify
  31. no_disk_in_drive:
  32.  
  33.