Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Peter Norton Programmer's Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

  Function 36H (decimal 54) is similar to function 1CH (which gets disk
  information), but also provides information about unused disk space, which
  function 1CH does not. Before calling this function, select the drive that
  you are interested in with the DL register: DL = 00H indicates the default
  drive, DL = 01H indicates drive A, DL = 02H indicates drive B, and so on.

  If you specify an invalid drive, function 36H returns FFFFH in the AX
  register. Otherwise, AX contains the number of sectors per cluster, CX
  contains the number of bytes per sector, BX contains the number of
  available clusters, and DX contains the total number of clusters.

  From these numbers you can make many interesting calculations, as follows:

    CX * AX = bytes per cluster
    CX * AX * BX = total number of free bytes
    CX * AX * DX = total storage space in bytes
    (BX * 100) / DX = percentage of free space

  If S were the size of a file in bytes, you could calculate the number of
  occupied clusters in this way:

    (S + CX * AX - 1) \ (CX * AX)

  Similar formulas would give you the number of sectors and the amount and
  proportion of space allocated to a file but not used (the slack space).

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson