home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / GETFATI.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-05-30  |  1.6 KB  |  73 lines

  1. ;/*
  2. ;** getfati.asm
  3. ;** contains: getfati()
  4. ;*/
  5.  
  6. DOSCALL         equ    021h        ;DOS Software Interrupt
  7. ALLOCTABLEINFO        equ    01ch        ;DOS Allocation table information
  8.                         ;for specific device
  9.  
  10.         include model.h
  11.         include prologue.h
  12.  
  13. FATINFO struc
  14.     MediaDescriptor dd    ?        ;32 bit pointer to media descriptor byte
  15.     PhysicalSecSize dw    ?        ;size of physical sector
  16.     AllocationUnits dw    ?        ;number of allocation units
  17.     SecPerAllocUnit db    ?        ;number of sectors per allocation unit
  18. FATINFO ends
  19.  
  20.         pseg    pgetfati
  21.  
  22.  
  23. ;/*
  24. ;**  void
  25. ;** getfati(unsigned char drive,FATINFO *finfo)
  26. ;**
  27. ;** ARGUMENT(s)
  28. ;**    drive        -        drive number.  0=default
  29. ;**                    1=A:, 2=B: etc.
  30. ;**
  31. ;**    finfo        -        pointer to a FATINFO structure
  32. ;**                    that is filled in with the
  33. ;**                    values obtained from this call.
  34. ;**
  35. ;** DESCRIPTION
  36. ;**  Returns allocation table information for a specifiec device.
  37. ;**
  38. ;**
  39. ;** RETURNS
  40. ;**  void
  41. ;**
  42. ;** AUTHOR
  43. ;**  ""   Mon 14-Nov-1988    17:13:34
  44. ;**   Copyright (C)1988-1990 Greenleaf Software Inc. All Rights Reserved.
  45. ;**
  46. ;** MODIFICATIONS
  47. ;**
  48. ;*/
  49.         cproc    getfati
  50.         push    ds
  51.         mov    dl,parm1_
  52.         mov    ah,ALLOCTABLEINFO
  53.         int    DOSCALL
  54.         mov    di,ds
  55.         if    _LDATA
  56.          lds    si,parm2_        ;DS:SI points to table
  57.         else
  58.          pop    ds            ;get original DS back
  59.          mov    si,parm2_        ;DS:SI points to table
  60.         endif
  61.         mov    [si+PhysicalSecSize],cx ;save values in structure
  62.         mov    [si+AllocationUnits],dx
  63.         mov    [si+SecPerAllocUnit],al
  64.         mov    word ptr [si+MediaDescriptor],bx
  65.         mov    word ptr [si+MediaDescriptor+2],di
  66.         if    _LDATA
  67.          pop     ds
  68.         endif
  69.  
  70.         cproce
  71.         endps
  72.         end
  73.