home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 1 / FishNMoreVol1.bin / more / code_examples / librar / chkdsk.c < prev    next >
Text File  |  1989-02-08  |  818b  |  34 lines

  1. /*--------------------------------------*/
  2. /*                    */
  3. /*               CHKDSK(X)        */
  4. /*                    */
  5. /* Functionality:            */
  6. /*     Finds the number of bytes free    */
  7. /*     on a disk.            */
  8. /* Arguments:                */
  9. /*    0: The number of the drive.     */
  10. /*       1 is A:, 2 is B:, etc.    */
  11. /* Functions used:            */
  12. /*    INT86()                */
  13. /* Returns: The number of free bytes.    */
  14. /* Author: John Callicotte        */
  15. /* Date created/modified: 09/01/88    */
  16. /*                    */
  17. /*--------------------------------------*/
  18.  
  19. # include "dos.h"
  20. long chkdsk(drive)
  21. int drive;
  22. {
  23.     union REGS outt;
  24.     long h;
  25.     outt.x.ax=54*256;    /* AH register = 54.  (DOS function 54) */
  26.  
  27.     outt.x.dx=drive;    /* DX register contains drive number. */
  28.  
  29.     int86(33,&outt,&outt);     /* Make the DOS call. */
  30.  
  31.     h=(long)outt.x.ax*(long)outt.x.bx*(long)outt.x.cx;
  32.     return(h);
  33. }
  34.