home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 1
/
FishNMoreVol1.bin
/
more
/
code_examples
/
librar
/
chkdsk.c
< prev
next >
Wrap
Text File
|
1989-02-08
|
818b
|
34 lines
/*--------------------------------------*/
/* */
/* CHKDSK(X) */
/* */
/* Functionality: */
/* Finds the number of bytes free */
/* on a disk. */
/* Arguments: */
/* 0: The number of the drive. */
/* 1 is A:, 2 is B:, etc. */
/* Functions used: */
/* INT86() */
/* Returns: The number of free bytes. */
/* Author: John Callicotte */
/* Date created/modified: 09/01/88 */
/* */
/*--------------------------------------*/
# include "dos.h"
long chkdsk(drive)
int drive;
{
union REGS outt;
long h;
outt.x.ax=54*256; /* AH register = 54. (DOS function 54) */
outt.x.dx=drive; /* DX register contains drive number. */
int86(33,&outt,&outt); /* Make the DOS call. */
h=(long)outt.x.ax*(long)outt.x.bx*(long)outt.x.cx;
return(h);
}