home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10422 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  1.2 KB

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!yale.edu!jvnc.net!princeton!rutgers!uwvax!zazen!uwec.edu!nyeda
  2. From: nyeda@cnsvax.uwec.edu (David Nye)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: LASTDRIVE function/asm/ect... Need one!
  5. Message-ID: <1992Nov8.155834.2200@cnsvax.uwec.edu>
  6. Date: 8 Nov 92 21:58:34 GMT
  7. References: <1992Nov8.081922.15576@ra.msstate.edu>
  8. Organization: University of Wisconsin Eau Claire
  9. Lines: 15
  10.  
  11. There is source code for this in the disk that accompanies the book
  12. Undocumented DOS by Andrew Schulman et al.  Every programmer who
  13. writes under DOS should have a copy.  I don't think the code is PD
  14. so I can't post it.  Basically, you call Int 21h fn 19h to get the
  15. current drive and then Int 21h fn 0Eh to select that drive.  As a
  16. byproduct of doing this, LASTDRIVE is returned in AL.  Bear in mind
  17. that LASTDRIVE does not contain the number of drives in the system,
  18. only the size of the array built to hold disk information (the
  19. Current Directory Structure array).  There often are fewer drives
  20. than LASTDRIVE, and may be more if the machine is networked.  The
  21. only reliable way to actually count drives is to walk the Drive
  22. Parameter Block chain.
  23.  
  24. David Nye
  25. nyeda@cnsvax.uwec.edu
  26.