home *** CD-ROM | disk | FTP | other *** search
- ;/*
- ;** getfati.asm
- ;** contains: getfati()
- ;*/
-
- DOSCALL equ 021h ;DOS Software Interrupt
- ALLOCTABLEINFO equ 01ch ;DOS Allocation table information
- ;for specific device
-
- include model.h
- include prologue.h
-
- FATINFO struc
- MediaDescriptor dd ? ;32 bit pointer to media descriptor byte
- PhysicalSecSize dw ? ;size of physical sector
- AllocationUnits dw ? ;number of allocation units
- SecPerAllocUnit db ? ;number of sectors per allocation unit
- FATINFO ends
-
- pseg pgetfati
-
-
- ;/*
- ;** void
- ;** getfati(unsigned char drive,FATINFO *finfo)
- ;**
- ;** ARGUMENT(s)
- ;** drive - drive number. 0=default
- ;** 1=A:, 2=B: etc.
- ;**
- ;** finfo - pointer to a FATINFO structure
- ;** that is filled in with the
- ;** values obtained from this call.
- ;**
- ;** DESCRIPTION
- ;** Returns allocation table information for a specifiec device.
- ;**
- ;**
- ;** RETURNS
- ;** void
- ;**
- ;** AUTHOR
- ;** "" Mon 14-Nov-1988 17:13:34
- ;** Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
- ;**
- ;** MODIFICATIONS
- ;**
- ;*/
- cproc getfati
- push ds
- mov dl,parm1_
- mov ah,ALLOCTABLEINFO
- int DOSCALL
- mov di,ds
- if _LDATA
- lds si,parm2_ ;DS:SI points to table
- else
- pop ds ;get original DS back
- mov si,parm2_ ;DS:SI points to table
- endif
- mov [si+PhysicalSecSize],cx ;save values in structure
- mov [si+AllocationUnits],dx
- mov [si+SecPerAllocUnit],al
- mov word ptr [si+MediaDescriptor],bx
- mov word ptr [si+MediaDescriptor+2],di
- if _LDATA
- pop ds
- endif
-
- cproce
- endps
- end
-