Note: This API call is for DOS and Win16 personality only. Use Family API for portability.
2 and higher
GET FREE DISK SPACE
AH = 36h
DL = drive number (00h = default, 01h = A:, etc)
AX = FFFFh if invalid drive
else
AX = sectors per cluster
BX = number of free clusters
CX = bytes per sector
DX = total clusters on drive
free space on drive in bytes is AX * BX * CX
total space on drive in bytes is AX * CX * DX
“lost clusters” are considered to be in use
according to Dave Williams' MS-DOS reference, the value in DX is incorrect for non-default drives after ASSIGN is run
this function does not return proper results on CD-ROMs; use AX=4402h“CD-ROM” instead
(FAT32 drive) the reported total and free space are limited to 2G-32K should they exceed that value
Text based on Ralf Brown Interrupt List Release 61
| osFree Macro Library | |
|---|---|
| Video I/O | @SetMode @SetCurSz @SetCurPos @GetCur @SetPage @ScrollUp @ScrollDn @Scroll @GetChAtr @PutChAtr @PutCh @SetPalet @SetColor @SetDot @GetDot @WrtTTY @VideoState @GetMode @GetDisplay @GetVideoState @GetEGAInfo @Cls |
| Hardware info | @Equipment @MemSize |
| Serial I/O | @AuxInit @AuxSendChar @AuxRecieveChar @AuxStatus |
| Tape I/O | @TapeOn @TapeOff @TapeRead @TapeWrite |
| Keyboard I/O | @KbdStatus @CharIn @CharPeek |
| Printer I/O | @PrnPrint @PrnInit @PrnStatus |
| Disk I/O | @DskReset @DskStatus @DskRead @DskWrite @DskVerify @DskFormat |
| Date and Time | @SetTime @GetTime |
| Mouse | @MouInit @MouShowPointer @MouStatus @MouSetPos @MouSetMickey @MouRegion |
| Memory manager | @ModBlok SET_BLOCK |