INT 13H 05H: Format Track

                                                              [PC] [XT] [AT]
 Expects: AH    05H
          CX    track (cylinder) number in the high 10 bits (see below)
          DL    drive: 0-3=diskette; 80H-81H=hard disk
          DH    head number
          ES:BX addr of buffer containing formatting info (see notes)
          
 Returns: AH    BIOS disk error code if CF is set to CY
          
    Info: This formats a single track on one head of a diskette or hard
          disk.  Any existing data on that track is destroyed.

       CX Bits 6-7 of CL are the high two bits of the 10-bit value whose
          low 8 bits are in CH.  See INT 13H 02H for details.

    ES:BX The layout of the data ate ES:BX varies by drive type and BIOS:

       PC (and all diskette operations)
          ES:BX points to a series of 4-byte values, one for each sector on
          the track.  The layout is 'CHSL':

          Offset Size Contents
            
           +0     1   bCylinder   track number: 0-n
           +1     1   bHead       head number: 0-n
           +2     1   bSector     sector number: 1-n
           +3     1   bLenCode    0=128, 1=125, 2=512, 3=1024

          There is one of these 4-byte structures for each sector on the
          track (for instance, 36 bytes for a 9-sector-per-track diskette).
          Interleave is set up by organizing them non-sequentially (e.g.,
          1,5,2,6,3,7,4,8)

       AT (and all modern hard disk drives and BIOSes)
          ES:BX points to a series of 2-byte values, one for each sector on
          the track.  The layout is 'FS':

          Offset Size Contents
            
           +0     1   bFlag       00=good, 80=bad/unusable
           +1     1   bSector     head number: 0-n
                  2               length of one record

          There is one of these 2-byte structures for each sector on the
          track (for instance, 110 bytes for a 55-sector-per-track hard
          disk).  Interleave is set up by organizing them non-sequentially.

       XT (very old XT BIOSes only)
          ES:BX is not used; instead AL contains an interleave value
          between 1 and 16.

See Also: DOS fn 440dH 42H (IOCTL format track)
          INT 13H: BIOS Disk I/O
          BIOS Data Area
          ROM-BIOS Functions
                                    -*-