home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 3 / CDASC03.ISO / sorties / 314 / tables.txt < prev   
Text File  |  1993-04-01  |  91KB  |  2,554 lines

  1. @Tables and Formats used by DOS & BIOS           Copyright 1991 David Jurgens
  2. :backup headers
  3. ^DOS BACKUP Control Information
  4.  
  5. %    BACKUPID.@@@ Format
  6.  
  7. %     Offset Size        Description
  8.     00   byte   Disk sequence flag:
  9.             00  indicates disk is not the last backup diskette
  10.             FF  indicates disk is the last backup diskette
  11.     01   word   Floppy disk sequence number (Intel format)
  12.     03   word   Backup year, four digits (Intel format)
  13.     05   byte   Day of month (1-31)
  14.     06   byte   Month of year (1-12)
  15.     07   dword  System time if /T was specified (see ~FILE ATTRIBUTES~)
  16.     0B 117bytes Unused
  17.  
  18.  
  19. %    Backup File Header
  20.  
  21. %     Offset Size        Description
  22.     00   byte   Disk sequence flag:
  23.             00  indicates disk is not the last backup diskette
  24.             FF  indicates disk is the last backup diskette
  25.     01   byte   Floppy disk sequence number
  26.     02  3bytes  Unused
  27.     05 64bytes  Full pathname (without drive designator)
  28.     45 14bytes  Unused
  29.     53   byte   Length of file path name at offset 05 plus 1
  30.     54 44Bytes  Unused
  31. :BIOS Parameter Block:BPB
  32. ^BPB - BIOS Parameter Block
  33.  
  34. %     Offset Size        Description
  35.  
  36.     00   word    sector size in bytes
  37.     02   byte    sectors per cluster (allocation unit size)
  38.     03   word    number of reserved sectors
  39.     05   byte    number of FATs on disk
  40.     06   word    number of root directory entries (directory size)
  41.     08   word    number of total sectors; if partition > 32Mb then set
  42.             to zero and dword at 15h contains the actual count
  43.     0A   byte    media descriptor byte  (see ~MEDIA DESCRIPTOR~)
  44.     0B   word    sectors per ~FAT~
  45.  
  46. %    Additional/different fields for DOS 3.0+
  47.     0D   word    sectors per track
  48.     0F   word    number of heads
  49.     11   word    number of hidden sectors
  50.     15 11bytes    reserved
  51.  
  52. %    Additional/different fields for DOS 4.0+
  53.     15   dword    number of total sectors if offset 8 is zero
  54.     19  6bytes    reserved
  55.     1F   word    number of cylinders
  56.     21   byte    device type
  57.     22   word    device attributes
  58.  
  59.     - located in the boot sector at offset 0Bh
  60.  
  61.     - see    ~BOOT SECTOR~
  62. :Batch Control Block:BCB
  63. ^BCB - Batch Control Block (undocumented)
  64.  
  65. ^DOS 2.x thru DOS 3.2  BCB Format
  66.  
  67. %     Offset Size           Description
  68.  
  69.     00   byte    unknown
  70.     01   word    if non-zero; segment of control block for active FOR
  71.     03   byte    type of batch command
  72.                 0 - normal batch command
  73.                 1 - FOR-loop active
  74.     04   dword    offset of next command to execute in batch file
  75.     07   word    offset of variable %0 (batch file name)
  76.     09  9 words    offset of %N batch file parameters, 0FFFFh indicates
  77.             parameter is null
  78.     1C   nbytes    null terminated path and filename of the current
  79.             batch file immediately followed by command line
  80.             parameters.  Each parameter %0-%9 plus a CR is
  81.             appended and resulting string is null terminated.
  82.  
  83.  
  84. ^DOS 3.3  BCB Format
  85.  
  86. %     Offset Size           Description
  87.  
  88.     00   byte    unknown
  89.     01   byte    global echo switch, if exec'd by batch CALL-command
  90.                 1 - turn ECHO ON on return to calling batch file
  91.                 0 - turn ECHO OFF on return to calling batch file
  92.     02   word    batch file BCD segment if executed via CALL
  93.                 if zero; batch file was called from command line
  94.                 if non-zero; batch file executed via CALL-command
  95.     04   word    if non-zero; segment of control block for active FOR
  96.     06   byte    type of batch command
  97.                 0 - normal batch command
  98.                 1 - FOR-loop active
  99.     07   dword    offset of next command to execute in batch file
  100.     0B   word    offset of variable %0 (batch file name)
  101.     0D  9words    offset of %N batch file parameters, 0FFFFh indicates
  102.             parameter is null
  103.     1F  nbytes    null terminated path and filename of the current
  104.             batch file immediately followed by command line
  105.             parameters.  Each parameter %0-%9 plus a CR is
  106.             appended and resulting string is null terminated.
  107.  
  108.  
  109.     - BCB length is variable and depends on the size and count of the
  110.       parameters and fully qualified batch file name
  111.     - the MCB for a BCB has a process Id of the transient portion of
  112.       the latest COMMAND.COM
  113.     - offsets displayed are relative to the BCB segment
  114.     - SHIFT command changes the offsets of the parameters in the table
  115.       at the offsets 0B0h thru 1Ch
  116.     - BCB  of DOS 3.3 is the  same as earlier versions except 3 bytes
  117.       were added after offset 0
  118.     - to find a BCB, locate the first block in the MCB chain belonging
  119.       to COMMAND.COM (the second allocated block always belongs to
  120.       COMMAND.COM).  Then scan the ~MCB~ chain for a 64 byte block with
  121.       the same owner ID as COMMAND.COM).  This will be the BCB.
  122. :BIOS Data Area:BDA:BIOS memory:memory map
  123. ^BDA - BIOS Data Area - PC Memory Map
  124.  
  125. %    Address Size       Description
  126.  
  127.     00:00 256dwords Interrupt vector table
  128.     30:00 256bytes    Stack area used during post and bootstrap
  129.     40:00    word    COM1 port address
  130.     40:02    word    COM2 port address
  131.     40:04    word    COM3 port address
  132.     40:06    word    COM4 port address
  133.     40:08    word    LPT1 port address
  134.     40:0A    word    LPT2 port address
  135.     40:0C    word    LPT3 port address
  136.     40:0E    word    LPT4 port address (except PS/2)
  137.             Extended BIOS Data Area segment (PS/2, see ~EBDA~)
  138.     40:10  2 bytes    Equipment list flags (see ~INT 11~)
  139.  
  140.         │7│6│5│4│3│2│1│0│ 40:10 (value in INT 11 register AL)
  141.          │ │ │ │ │ │ │ └─ diskette drive(s) installed
  142.          │ │ │ │ │ │ └── math coprocessor
  143.          │ │ │ │ ├─┼─── old PC system board RAM < 256K
  144.          │ │ │ │ │ └── pointing device installed (PS/2)
  145.          │ │ │ │ └─── not used on PS/2
  146.          │ │ └─┴──── initial video mode
  147.          └─┴─────── # of diskette drives, less 1
  148.  
  149.         │7│6│5│4│3│2│1│0│ 40:11  (value in INT 11 register AH)
  150.          │ │ │ │ │ │ │ └─ 0 if DMA installed
  151.          │ │ │ │ └─┴─┴── number of serial ports
  152.          │ │ │ └─────── game adapter
  153.          │ │ └──────── not used, internal modem (PS/2)
  154.          └─┴───────── number of printer ports
  155.  
  156.     40:12    byte    PCjr: infrared keyboard link error count
  157.     40:13    word    Memory size in Kbytes  (see ~INT 12~)
  158.     40:15    byte    Reserved
  159.     40:16    byte    PS/2 BIOS control flags
  160.     40:17    byte    Keyboard flag byte 0 (see ~KB FLAGS~)
  161.  
  162.         │7│6│5│4│3│2│1│0│ keyboard flag byte 0
  163.          │ │ │ │ │ │ │ └─── right shift key depressed
  164.          │ │ │ │ │ │ └──── left shift key depressed
  165.          │ │ │ │ │ └───── CTRL key depressed
  166.          │ │ │ │ └────── ALT key depressed
  167.          │ │ │ └─────── scroll-lock is active
  168.          │ │ └──────── num-lock is active
  169.          │ └───────── caps-lock is active
  170.          └────────── insert is active
  171.  
  172.     40:18    byte    Keyboard flag byte 1 (see ~KB FLAGS~)
  173.  
  174.         │7│6│5│4│3│2│1│0│ keyboard flag byte
  175.          │ │ │ │ │ │ │ └─── left CTRL key depressed
  176.          │ │ │ │ │ │ └──── left ALT key depressed
  177.          │ │ │ │ │ └───── system key depressed and held
  178.          │ │ │ │ └────── suspend key has been toggled
  179.          │ │ │ └─────── scroll lock key is depressed
  180.          │ │ └──────── num-lock key is depressed
  181.          │ └───────── caps-lock key is depressed
  182.          └────────── insert key is depressed
  183.  
  184.     40:19    byte    Storage for alternate keypad entry
  185.     40:1A    word    Offset from 40:00 to keyboard buffer head
  186.     40:1C    word    Offset from 40:00 to keyboard buffer tail
  187.     40:1E  32bytes    Keyboard buffer (circular queue buffer)
  188.     40:3E    byte    Drive recalibration status
  189.  
  190.         │7│6│5│4│3│2│1│0│ drive recalibration status
  191.          │ │ │ │ │ │ │ └── 1=recalibrate drive 0
  192.          │ │ │ │ │ │ └─── 1=recalibrate drive 1
  193.          │ │ │ │ │ └──── 1=recalibrate drive 2
  194.          │ │ │ │ └───── 1=recalibrate drive 3
  195.          │ └─┴─┴────── unused
  196.          └─────────── 1=working interrupt flag
  197.  
  198.     40:3F    byte    Diskette motor status
  199.  
  200.         │7│6│5│4│3│2│1│0│ diskette motor status
  201.          │ │ │ │ │ │ │ └── 1=drive 0 motor on
  202.          │ │ │ │ │ │ └─── 1=drive 1 motor on
  203.          │ │ │ │ │ └──── 1=drive 2 motor on
  204.          │ │ │ │ └───── 1=drive 3 motor on
  205.          │ └─┴─┴────── unused
  206.          └─────────── 1=write operation
  207.  
  208.     40:40    byte    Motor shutoff counter (decremented by ~INT 8~)
  209.     40:41    byte    Status of last diskette operation (see ~INT 13,1~)
  210.  
  211.         │7│6│5│4│3│2│1│0│ status of last diskette operation
  212.          │ │ │ │ │ │ │ └─── invalid diskette command
  213.          │ │ │ │ │ │ └──── diskette address mark not found
  214.          │ │ │ │ │ └───── sector not found
  215.          │ │ │ │ └────── diskette DMA error
  216.          │ │ │ └─────── CRC check / data error
  217.          │ │ └──────── diskette controller failure
  218.          │ └───────── seek to track failed
  219.          └────────── diskette time-out
  220.  
  221.     40:42  7 bytes    NEC diskette controller status (see ~FDC~)
  222.     40:49    byte    Current video mode  (see ~VIDEO MODE~)
  223.     40:4A    word    Number of screen columns
  224.     40:4C    word    Size of current video regen buffer in bytes
  225.     40:4E    word    Offset of current video page in video regen buffer
  226.     40:50  8 words    Cursor position of pages 1-8, high order byte=row
  227.             low order byte=column; changing this data isn't
  228.             reflected immediately on the display
  229.     40:60    byte    Cursor ending (bottom) scan line (don't modify)
  230.     40:61    byte    Cursor starting (top) scan line (don't modify)
  231.     40:62    byte    Active display page number
  232.     40:63    word    Base port address for active ~6845~ CRT controller
  233.             3B4h = mono, 3D4h = color
  234.     40:65    byte    6845 CRT mode control register value (port 3x8h)
  235.             EGA/VGA values emulate those of the MDA/CGA
  236.     40:66    byte    CGA current color palette mask setting (port 3d9h)
  237.             EGA and VGA values emulate the CGA
  238.     40:67    dword    CS:IP for 286 return from protected mode
  239.         dword    Temp storage for SS:SP during shutdown
  240.         dword    Day counter on all products after AT
  241.         dword    PS/2 Pointer to reset code with memory preserved
  242.         5 bytes    Cassette tape control (before AT)
  243.     40:6C    dword    Daily timer counter, equal to zero at midnight;
  244.             incremented by INT 8; read/set by ~INT 1A~ on most
  245.             BIOS's. Cannot be trusted with some AT&T machines.
  246.     40:70    byte    Clock rollover flag, set when 40:6C exceeds 24hrs
  247.     40:71    byte    BIOS break flag, bit 7 is set if ~Ctrl-Break~ was
  248.             *ever* hit; set by ~INT 9~
  249.     40:72    word    Soft reset flag via Ctl-Alt-Del or JMP FFFF:0
  250.  
  251.             1234h  Bypass memory tests & CRT initialization
  252.             4321h  Preserve memory
  253.             5678h  System suspend
  254.             9ABCh  Manufacturer test
  255.             ABCDh  Convertible POST loop
  256.             ????h  many other values are used during POST
  257.  
  258.     40:74    byte    Status of last hard disk operation (see ~INT 13,1~)
  259.     40:75    byte    Number of hard disks attached
  260.     40:76    byte    XT fixed disk drive control byte
  261.     40:77    byte    Port offset to current fixed disk adapter
  262.     40:78  4 bytes    Time-Out value for LPT1,LPT2,LPT3(,LPT4 except PS/2)
  263.     40:7C  4 bytes    Time-Out value for COM1,COM2,COM3,COM4
  264.     40:80    word    Keyboard buffer start offset (seg=40h,BIOS 10-27-82)
  265.     40:82    word    Keyboard buffer end offset (seg=40h,BIOS 10-27-82)
  266.     40:84    byte    Rows on the screen (less 1, EGA+)
  267.     40:85    word    Point height of character matrix (EGA+)
  268.         byte    PCjr: character to be repeated if the typematic
  269.             repeat key takes effect
  270.     40:86    byte    PCjr: initial delay before repeat key action begins
  271.     40:87    byte    PCjr: current Fn function key number
  272.         byte    Video mode options (EGA+)
  273.  
  274.         │7│6│5│4│3│2│1│0│ Video mode options (EGA+)
  275.          │ │ │ │ │ │ │ └── 1=alphanumeric cursor emulation enabled
  276.          │ │ │ │ │ │ └─── 1=video subsystem attached to monochrome
  277.          │ │ │ │ │ └──── reserved
  278.          │ │ │ │ └───── 1=video subsystem is inactive
  279.          │ │ │ └────── reserved
  280.          │ └─┴─────── video RAM  00-64K  10-192K  01-128K  11-256K
  281.          └────────── video mode number passed to ~INT 10~, function 0
  282.  
  283.     40:88    byte    PCjr: third keyboard status byte
  284.             EGA feature bit switches, emulated on VGA
  285.  
  286.         │7│6│5│4│3│2│1│0│ EGA feature bit switches (EGA+)
  287.          │ │ │ │ │ │ │ └── EGA SW1 config (1=off)
  288.          │ │ │ │ │ │ └─── EGA SW2 config (1=off)
  289.          │ │ │ │ │ └──── EGA SW3 config (1=off)
  290.          │ │ │ │ └───── EGA SW4 config (1=off)
  291.          │ │ │ └────── Input FEAT0 (ISR0 bit 5) after output on FCR0
  292.          │ │ └─────── Input FEAT0 (ISR0 bit 6) after output on FCR0
  293.          │ └──────── Input FEAT1 (ISR0 bit 5) after output on FCR1
  294.          └───────── Input FEAT1 (ISR0 bit 6) after output on FCR1
  295.  
  296.     40:89    byte    Video display data area (MCGA and VGA)
  297.  
  298.         │7│6│5│4│3│2│1│0│ Video display data area (MCGA and VGA)
  299.          │ │ │ │ │ │ │ └── 1=VGA is active
  300.          │ │ │ │ │ │ └─── 1=gray scale is enabled
  301.          │ │ │ │ │ └──── 1=using monochrome monitor
  302.          │ │ │ │ └───── 1=default palette loading is disabled
  303.          │ │ │ └────── see table below
  304.          │ │ └─────── reserved
  305.          │ └────────  1=display switching enabled
  306.          └───────── alphanumeric scan lines (see table below)
  307.  
  308. %          Bit7    Bit4    Scan Lines
  309.         0    0    350 line mode
  310.         0    1    400 line mode
  311.         1    0    200 line mode
  312.         1    1    reserved
  313.  
  314.     40:8A    byte    Display Combination Code (DCC) table index (EGA+)
  315.     40:8B    byte    Last diskette data rate selected
  316.  
  317.         │7│6│5│4│3│2│1│0│ last diskette data rate selected
  318.          │ │ │ │ └─┴─┴─┴─── reserved
  319.          │ │ └─┴────────── last floppy drive step rate selected
  320.          └─┴──────────── last floppy data rate selected
  321.  
  322. %        Data Rate             Step Rate
  323.         00  500K bps        00  step rate time of 0C
  324.         01  300K bps        01  step rate time of 0D
  325.         10  250K bps        10  step rate time of 0A
  326.         11  reserved        11  reserved
  327.  
  328.     40:8C    byte    Hard disk status returned by controller
  329.     40:8D    byte    Hard disk error returned by controller
  330.     40:8E    byte    Hard disk interrupt control flag(bit 7=working int)
  331.     40:8F    byte    Combination hard/floppy disk card when bit 0 set
  332.     40:90  4 bytes    Drive 0,1,2,3 media state
  333.  
  334.         │7│6│5│4│3│2│1│0│ drive media state (4 copies)
  335.          │ │ │ │ │ └─┴─┴─── drive/media state (see below)
  336.          │ │ │ │ └─────── reserved
  337.          │ │ │ └─────── 1=media/drive established
  338.          │ │ └─────── double stepping required
  339.          └─┴─────── data rate:    00=500K bps    01=300K bps
  340.                     10=250K bps    11=reserved
  341. %        Bits
  342. %        210  Drive Media State
  343.         000  360Kb diskette/360Kb drive not established
  344.         001  360Kb diskette/1.2Mb drive not established
  345.         010  1.2Mb diskette/1.2Mb drive not established
  346.         011  360Kb diskette/360Kb drive established
  347.         100  360Kb diskette/1.2Mb drive established
  348.         101  1.2Mb diskette/1.2Mb drive established
  349.         110  Reserved
  350.         111  None of the above
  351.  
  352.     40:94    byte    Track currently seeked to on drive 0
  353.     40:95    byte    Track currently seeked to on drive 1
  354.     40:96    byte    Keyboard mode/type
  355.  
  356.         │7│6│5│4│3│2│1│0│ Keyboard mode/type
  357.          │ │ │ │ │ │ │ └─── last code was the E1 hidden code
  358.          │ │ │ │ │ │ └──── last code was the E0 hidden code
  359.          │ │ │ │ │ └───── right CTRL key depressed
  360.          │ │ │ │ └────── right ALT key depressed
  361.          │ │ │ └─────── 101/102 enhanced keyboard installed
  362.          │ │ └──────── force num-lock if Rd ID & KBX
  363.          │ └───────── last char was first ID char
  364.          └────────── read ID in process
  365.  
  366.     40:97    byte    Keyboard LED flags
  367.  
  368.         │7│6│5│4│3│2│1│0│ Keyboard LED flags
  369.          │ │ │ │ │ │ │ └─── scroll lock indicator
  370.          │ │ │ │ │ │ └──── num-lock indicator
  371.          │ │ │ │ │ └───── caps-lock indicator
  372.          │ │ │ │ └────── circus system indicator
  373.          │ │ │ └─────── ACK received
  374.          │ │ └──────── re-send received flag
  375.          │ └───────── mode indicator update
  376.          └────────── keyboard transmit error flag
  377.  
  378.     40:98    dword    Pointer to user wait complete flag
  379.     40:9C    dword    User wait Time-Out value in microseconds
  380.     40:A0    byte    RTC wait function flag
  381.  
  382.         │7│6│5│4│3│2│1│0│ ~INT 15,86~ RTC wait function flag
  383.          │ │ │ │ │ │ │ └─── 1= wait pending
  384.          │ └─┴─┴─┴─┴─┴──── not used
  385.          └─────────────── 1=INT 15,86 wait time elapsed
  386.  
  387.     40:A1    byte    LANA DMA channel flags
  388.     40:A2  2 bytes    Status of LANA 0,1
  389.     40:A4    dword    Saved hard disk interrupt vector
  390.     40:A8    dword    BIOS Video Save/Override Pointer Table address
  391.             (see ~VIDEO TABLES~)
  392.     40:AC  8 bytes    Reserved
  393.     40:B4    byte    Keyboard NMI control flags (convertible)
  394.     40:B5    dword    Keyboard break pending flags (convertible)
  395.     40:B9    byte    Port 60 single byte queue (convertible)
  396.     40:BA    byte    Scan code of last key (convertible)
  397.     40:BB    byte    NMI buffer head pointer (convertible)
  398.     40:BC    byte    NMI buffer tail pointer (convertible)
  399.     40:BD  16bytes    NMI scan code buffer (convertible)
  400.     40:CE    word    Day counter (convertible and after)
  401.     40:F0  16bytes    Intra-Applications Communications Area (IBM Technical
  402.             Reference incorrectly locates this at 50:F0-50:FF)
  403.  
  404.  
  405. %    Address Size       Description     (BIOS/DOS Data Area)
  406.  
  407.     50:00    byte    Print screen status byte
  408.              00 = PrtSc not active,
  409.              01 = PrtSc in progress
  410.              FF = error
  411.     50:01  3 bytes    Used by BASIC
  412.     50:04    byte    DOS single diskette mode flag, 0=A:, 1=B:
  413.     50:05  10bytes    POST work area
  414.     50:0F    byte    BASIC shell flag; set to 2 if current shell
  415.     50:10    word    BASICs default DS value (DEF SEG)
  416.     50:12    dword    Pointer to BASIC ~INT 1C~ interrupt handler
  417.     50:16    dword    Pointer to BASIC ~INT 23~ interrupt handler
  418.     50:1A    dword    Pointer to BASIC ~INT 24~ disk error handler
  419.     50:20    word    DOS dynamic storage
  420.     50:22  14bytes    DOS diskette initialization table (~INT 1E~)
  421.     50:30    4bytes    MODE command
  422.     70:00        I/O drivers from IO.SYS/IBMBIO.COM
  423.  
  424. ^The following map varies in size and locus
  425.  
  426.     07C0:0        Boot code is loaded here at startup (31k mark)
  427.     A000:0        EGA/VGA RAM for graphics display mode 0Dh & above
  428.     B000:0        MDA RAM, Hercules graphics display RAM
  429.     B800:0        CGA display RAM
  430.     C000:0        EGA/VGA BIOS ROM (thru C7FF)
  431.     C400:0        Video adapter ROM space
  432.     C600:0 256bytes PGA communication area
  433.     C800:0     16K    Hard disk adapter BIOS ROM
  434.     C800:5        XT Hard disk ROM format, AH=Drive, AL=Interleave
  435.     D000:0     32K    Cluster adapter BIOS ROM
  436.     D800:0        PCjr conventionalsoftware cartridge address
  437.     E000:0     64K    Expansion ROM space (hardwired on AT+)
  438.          128K    PS/2 System ROM (thru F000)
  439.     F000:0        System monitor ROM
  440.             PCjr: software cartridge override address
  441.     F400:0        System expansion ROMs
  442.     F600:0        IBM ROM BASIC (AT)
  443.     F800:0        PCjr software cartridge override address
  444.     FC00:0        BIOS ROM
  445.     FF00:0        System ROM
  446.     FFA6:E        ROM graphics character table
  447.     FFFF:0        ROM bootstrap code
  448.     FFFF:5 8 bytes    ROM date (not applicable for all clones)
  449.     FFFF:E    byte    ROM machine id    (see ~MACHINE ID~)
  450.  
  451.  
  452. :boot sector:boot record
  453. ^Boot Sector (since DOS 2.0)
  454.  
  455. %     Offset  Size        Description
  456.  
  457.     00   3bytes    jump to executable code
  458.     03   8bytes    OEM name and version
  459.     0B   word    bytes per sector
  460.     0D   byte    sectors per cluster (allocation unit size)
  461.     0E   word    number of reserved sectors (starting at 0)
  462.     10   byte    number of FAT's on disk
  463.     11   word    number of root directory entries (directory size)
  464.     13   word    number of total sectors (0 if partition > 32Mb)
  465.     15   byte    media descriptor byte  (see ~MEDIA DESCRIPTOR~)
  466.     16   word    sectors per FAT
  467.     18   word    sectors per track  (DOS 3.0+)
  468.     1A   word    number of heads  (DOS 3.0+)
  469.     1C   word    number of hidden sectors  (DOS 3.0+)
  470.     20   dword    (DOS 4+) number of sectors if offset 13 was 0
  471.     24   byte    (DOS 4+) physical drive number
  472.     25   byte    (DOS 4+) reserved
  473.     26   byte    (DOS 4+) signature byte (29h)
  474.     27   dword    (DOS 4+) volume serial number
  475.     2B  11bytes    (DOS 4+) volume label
  476.     36   8bytes    (DOS 4+) reserved
  477.  
  478.  
  479.     - implementation format not guaranteed in all OEM DOS releases
  480.     - BIOS expects a boot sector of 512 bytes
  481.     - DOS 3.2 began reading BIOS Parameter Block (~BPB~) information from
  482.       the boot sector, previous versions used only the media byte in FAT
  483.     - DOS 4.x added offsets 20-3Dh and offset 20h determines the number
  484.       of sectors if offset 13h is zero
  485.     - hard disks have a master boot record and partition boot records;
  486.       the master boot record and ~Disk Partition Table~ (DPT) share the
  487.       same sector
  488.  
  489. :Box Drawing Chars
  490. ^Box Drawing Characters
  491.  
  492.        218  196  194  191          201  205  203  187
  493.         ┌─────────┬────┐             ╔═════════╦════╗
  494.     179 │    197  │    │ 179     186 ║    206  ║    ║ 186
  495.             │       \ │    │             ║       \ ║    ║
  496.     195 ├─────────┼────┤ 180     204 ╠═════════╬════╣ 185
  497.             │          │    │            ║         ║    ║
  498.             └─────────┴────┘             ╚═════════╩════╝
  499.          192  196  193  217            200  205  202  188
  500.  
  501.  
  502.        214  196  210  183             213  205  209  184
  503.             ╓─────────╥────╖            ╒═════════╤════╕
  504.         186 ║    215  ║    ║ 186    179 │    216  │    │ 179
  505.             ║       \ ║    ║            │       \ │    │
  506.         199 ╟─────────╫────╢ 182    198 ╞═════════╪════╡ 181
  507.             ║         ║    ║                │         │    │
  508.             ╙─────────╨────╜                ╘═════════╧════╛
  509.            211  196  208  189             212  205  207  190
  510.  
  511.  
  512.     - see   ~ASCII~
  513.  
  514. :code pages
  515. ^Code Page and Country Codes
  516.  
  517. %                  Country Keyboard    Valid Code
  518. %    Country            Code    Code      Pages
  519.  
  520.     Arabic            785         437
  521.     Australia        061     US     437,850
  522.     Belgium         032     BE     437,850
  523.     Canada (English)    001     US     437,850
  524.     Canada (French)        002     CF     863,850
  525.     Denmark         045     DK     865,850
  526.     Finland         358     SU     437,850
  527.     France            033     FR     437,850
  528.     Germany         049     GR     437,850
  529.     Hebrew            972         437
  530.     Italy            039     IT     437,850
  531.     Latin America        003     LA     437,850
  532.     Netherlands        031     NL     437,850
  533.     Norway            047     NO     865,850
  534.     Portugal        351     PO     860,850
  535.     Spain            034     SP     437,850
  536.     Sweden            046     SV     437,850
  537.     Switzerland (French)    041     SF     437,850
  538.     Switzerland (German)    041     SF     437,850
  539.     United Kingdom        044     UK     437,850
  540.     United States        001     US     437,850
  541.  
  542.     - code pages are lookup tables containing the definition
  543.       of one or more character sets
  544.     - contain country specific information
  545.     - implemented starting with DOS 3.3
  546.  
  547. :colors:color table
  548. ^Color Definitions
  549.  
  550. %    Definitions found in TURBO C's "conio.h"
  551.  
  552.     0 - BLACK    4 - RED        8 - DARKGRAY    C - LIGHTRED
  553.     1 - BLUE     5 - MAGENTA    9 - LIGHTBLUE   D - LIGHTMAGENTA
  554.     2 - GREEN    6 - BROWN        A - LIGHTGREEN  E - YELLOW
  555.     3 - CYAN     7 - LIGHTGRAY  B - LIGHTCYAN   F - WHITE
  556.  
  557.  
  558.        │7│6│5│4│3│2│1│0│ AL
  559.     │ │ │ │ │ │ │ └─── blue component of foreground color
  560.     │ │ │ │ │ │ └──── green component of foreground color
  561.     │ │ │ │ │ └───── red component of foreground color
  562.     │ │ │ │ └────── INTENSITY component of foreground color
  563.     │ │ │ └─────── blue component of background color
  564.     │ │ └──────── green component of background color
  565.     │ └───────── red component of background color
  566.     └────────── BLINKING of foreground character
  567.  
  568.     - see  ~ANSI~  for ANSI color definitions
  569. :country codes:country info
  570. ^DOS Country Codes   (DOS 2.x)
  571.  
  572. %     Offset Size        Description
  573.  
  574.     00   word    Date and time format
  575.               0 = month day year,  hh:mm:ss  (USA)
  576.               1 = day month year,  hh:mm:ss  (Europe)
  577.               2 = year month day,  hh:mm:ss  (Japan)
  578.     02  2bytes   ASCIIZ currency symbol
  579.     04  2bytes   ASCIIZ thousands separator
  580.     06  2bytes   ASCIIZ decimal separator
  581.     08  18bytes  Reserved
  582.  
  583.  
  584. ^DOS Country Codes   (DOS 3.0+)
  585.  
  586. %     Offset Size        Description
  587.  
  588.     00   word    Date and time format
  589.               0 = month day year,  hh:mm:ss  (USA)
  590.               1 = day month year,  hh:mm:ss  (Europe)
  591.               2 = year month day,  hh:mm:ss  (Japan)
  592.     02  5bytes   ASCIIZ currency symbol
  593.     07  2bytes   ASCIIZ thousands separator
  594.     09  2bytes   ASCIIZ decimal separator
  595.     0B  2bytes   ASCIIZ date separator
  596.     0D  2bytes   ASCIIZ time separator
  597.     0F   byte    Currency symbol format
  598.             0 = symbol leads, without space
  599.             1 = symbol follows, without space
  600.             2 = symbol leads, one space
  601.             3 = symbol follows, one space
  602.             4 = symbol replace decimal separator
  603.     10   byte    Number of digits after decimal
  604.     11   byte    Time format
  605.             Bit 0    = 0  12 hour clock
  606.                 = 1  24 hour clock
  607.     12   dword   Case map call address
  608.     16  2bytes   ASCIIZ data list separator
  609.     18  10bytes  Reserved
  610.  
  611.     - see also  ~INT 21,38~
  612.  
  613. :disk partition table:partition table
  614. ^Disk Partition Table (Fixed disk boot record)
  615.  
  616. %      Offset        Represents:  (see format below)
  617.  
  618.     01BE        Partition 1 data table  (16 bytes)
  619.     01CE        Partition 2 data table  (16 bytes)
  620.     01DE        Partition 3 data table  (16 bytes)
  621.     01EE        Partition 4 data table  (16 bytes)
  622.     01FE        Signature  (hex 55 AA, 2 bytes)
  623.  
  624. %    Offset from beginning of partition data shown above:
  625.  
  626. %     Offset Size        Description
  627.  
  628.     00   byte   boot indicator
  629.     01   byte   beginning sector head number
  630.     02   byte   beginning sector (2 high bits of cylinder #)
  631.     03   byte   beginning cylinder# (low order bits of cylinder #)
  632.     04   byte   system indicator
  633.     05   byte   ending sector head number
  634.     06   byte   ending sector (2 high bits of cylinder #)
  635.     07   byte   ending cylinder# (low order bits of cylinder #)
  636.     08   dword  number of sectors preceding the partition
  637.     0B   dword  number of sectors in the partition
  638.  
  639.  
  640. %    Boot indicator (BYTE)
  641.  
  642.     00  - non-bootable partition
  643.     80  - bootable partition (one partition only)
  644.  
  645.  
  646. %    System Indicator (BYTE)
  647.  
  648.     00 - unknown operating system
  649.     01 - DOS with 12 bit FAT, 16 bit sector number
  650.     02 - XENIX
  651.     04 - DOS with 16 bit FAT, 16 bit sector number
  652.     05 - DOS Extended partition (DOS 3.3+)
  653.     06 - DOS 4.0 (Compaq 3.31), 32 bit sector number
  654.     51 - Ontrack extended partition
  655.     64 - Novell
  656.     75 - PCIX
  657.     DB - CP/M
  658.     FF - BBT
  659.  
  660.  
  661. %    Signature
  662.  
  663.     Hex 55AA marks the end of valid boot sector.     This is also
  664.     required in each of the partition boot records.
  665.  
  666.  
  667. %    Sector/Cylinder
  668.  
  669.     2 bytes are combined to a word similar to INT 13:
  670.  
  671.     │7│6│5│4│3│2│1│0│ 1st byte  (sector)
  672.      │ │ └─┴─┴─┴─┴─┴── Sector offset within cylinder
  673.      └─┴───────────── High order bits of cylinder #
  674.  
  675.     │7│6│5│4│3│2│1│0│ 2nd byte  (cylinder)
  676.      └─┴─┴─┴─┴─┴─┴───── Low order bits of cylinder #
  677.  
  678.  
  679.     - all partitions begin on sector 1 head 0, except the first
  680.       partition which follows the disk's master boot record and begins
  681.       in sector 2
  682.     - some of this information may vary with some variants of DOS 3.2
  683.       and DOS 3.3 that use their own sectoring scheme for large disks
  684.  
  685.     - see  ~INT 21,32~  ~Disk Partition Table~
  686.  
  687. :device attributes
  688. ^Device Driver Attribute Values (brief)
  689.  
  690.        │F│E│D│C│B│A-7│6│5│4│3│2│1│0│
  691.     │ │ │ │ │  │  │ │ │ │ │ │ └── 1 = character device is stdin
  692.     │ │ │ │ │  │  │ │ │ │ │ │     1 = block dev supports generic IOCTL
  693.     │ │ │ │ │  │  │ │ │ │ │ └─── 1 = character device is stdout
  694.     │ │ │ │ │  │  │ │ │ │ │      1 = block dev supports generic IOCTL
  695.     │ │ │ │ │  │  │ │ │ │ └──── 1 = current NUL device
  696.     │ │ │ │ │  │  │ │ │ └───── 1 = current clock device
  697.     │ │ │ │ │  │  │ └─┴────── reserved by DOS
  698.     │ │ │ │ │  │  └───────── 1 = supports Get/Set logical device
  699.     │ │ │ │ │  └─────────── reserved (must be zero)
  700.     │ │ │ │ └───────────── 1 = supports removable media
  701.     │ │ │ └────────────── reserved (must be zero)
  702.     │ │ └─────────────── 1 = non-IBM format (block device)
  703.     │ │             1 = output until busy (char device)
  704.     │ └──────────────── 1 = supports IOCTL strings
  705.     └───────────────── 1 = character device, 0 = block device
  706.  
  707.     - true bit values are described, a false indicates opposite
  708.     - see  ~INT 21,44~  or  IOCTL,n where "n" is an IOCTL function
  709.  
  710.  
  711. ^Device Driver Attribute Bit Values (detailed)
  712.  
  713.      0  standard input device: used by character devices to
  714.         tell DOS a character device driver is the standard
  715.         input device.  For block devices, a 1 indicates generic
  716.         IOCTL supported
  717.  
  718.      1  standard output device: used by character devices to tell DOS a
  719.         character device driver is the standard output device.  For
  720.         block devices, a 1 indicates generic IOCTL supported
  721.  
  722.      2  NUL attribute:  used for character devices only.  Tells
  723.         DOS the character device driver is a NUL device.  This bit
  724.         is used by DOS to determine if the NUL device is being used.
  725.         The NUL device cannot be reassigned.
  726.  
  727.      3  clock device:  set to 1 to tell DOS this is the new CLOCK$ device.
  728.  
  729.     0B  open/close removable media:  set to 1 tells DOS the device
  730.         driver can handle removable media. (DOS 3.x)
  731.  
  732.     0D  non-IBM format: for block devices, indicates the method
  733.         the driver uses to determine media type.  Set to 1 for
  734.         drivers that use the BPB to determine media type, set to
  735.         zero for drivers that use the media descriptor byte.  For
  736.         character devices (usually printers), set to 1 if the
  737.         driver supports output until busy, set to 0 otherwise.
  738.  
  739.     0E  IOCTL bit:    used with both character and block devices.
  740.         Indicates if the device driver can handle control strings
  741.         through the IOCTL.    Zero if a device driver can't process
  742.         control strings.  If an attempt to send/receive an IOCTL
  743.         control strings, is made without this bit set, an error code
  744.         is returned.  The IOCTL functions allow data to be sent to
  745.         and from the driver without doing normal reads or writes.
  746.         The device driver can use the data for information.  It is
  747.         up to the device to interpret the string, but the information
  748.         must not be treated as a normal I/O request.  Affects
  749.         only IOCTL functions  AL=2 and AL=5.
  750.  
  751.     0F  device type:  used to indicate block or character device.
  752.  
  753. :device command codes
  754. ^Device Command Codes (Device Request Header)
  755.  
  756. %      Code        Function
  757.  
  758.     0    INIT
  759.     1    MEDIA CHECK    (block devices,character = NOP)
  760.     2    BUILD BPB        (block devices,character = NOP)
  761.     3    IOCTL
  762.     4    INPUT        (read)
  763.     5    NONDESTRUCTIVE INPUT NO WAIT (character devices)
  764.     6    INPUT STATUS    (character devices)
  765.     7    INPUT FLUSH    (character devices)
  766.     8    OUTPUT        (write)
  767.     9    OUTPUT        (write with verify)
  768.     10   OUTPUT STATUS    (character devices)
  769.     11   OUTPUT FLUSH    (character devices)
  770.     12   IOCTL OUTPUT
  771.     13   DEVICE OPEN    (DOS 3.x)
  772.     14   DEVICE CLOSE    (DOS 3.x)
  773.     15   REMOVABLE MEDIA    (DOS 3.x)
  774.  
  775. :device header
  776. ^Device Driver Header
  777.  
  778.  
  779. %     Offset Size        Description
  780.  
  781.     00   dword  pointer to next device header
  782.     04   word   attribute  (see ~DEVICE ATTRIBUTE~)
  783.     06   word   pointer to device strategy routine
  784.     08   word   pointer to device interrupt routine
  785.     0A  8bytes  name/unit field
  786.  
  787.  
  788.  
  789.     - see  ~INT 21,44~ and IOCTL,n where "n" is an IOCTL function
  790.  
  791. :device request headr
  792. ^Device Request Header Format
  793.  
  794.  
  795. %     Offset Size        Description
  796.  
  797.     00   byte    length in bytes of the request header
  798.     01   byte    unit code;  the sub-unit the operation is for (block
  799.             devices);  meaningless for character devices
  800.     02   word    command code, (see ~DEVICE COMMANDS~)
  801.     04  8bytes    reserved for DOS
  802.     0C  nbytes    request data  (variable length)
  803.  
  804.  
  805.     - see  ~INT 21,44~  or    ~DEVICE ATTRIBUTES~  or  ~DEVICE CODES~
  806.     - see also  IOCTL,n where "n" is an IOCTL function
  807.  
  808. :device status
  809. ^Device Status Word
  810.  
  811.     The device status word is set to zero on entry and is set by
  812.     the driver interrupt routine on return.
  813.  
  814.     │15│14-10│9│8│7-0│ STATUS word
  815.      │    │   │ │  └──── Error return code (if bit 15=1)
  816.      │    │   │ └────── Done bit, function completed
  817.      │    │   └─────── Busy bit
  818.      │    └────────── Reserved
  819.      └───────────── Error flag bits 0-7 have error code
  820.  
  821. %    Error return codes
  822.  
  823.     00  Write protect violation    01  Unknown unit
  824.     02  Device not ready        03  Unknown command
  825.     04  CRC error            05  Bad drive request structure length
  826.     06  Seek error            07  Unknown media
  827.     08  Sector not found        09  Printer out of paper
  828.     0A  Write fault         0B  Read fault
  829.     0C  General failure        0D  Reserved
  830.     0E  Reserved            0F  Invalid disk change
  831.  
  832. :directory format
  833. ^DIRECTORY - DOS Directory Structure
  834.  
  835. %    Byte    Description
  836.  
  837.     00    Filename status:
  838.         00 = Filename never used
  839.         05 = First character of filename is E5
  840.         E5 = File has been erased
  841.         2E = This is a subdirectory entry
  842.     00-07    Filename, left justified
  843.     08-0A    Filename extension, left justified
  844.     0B    File's attribute:
  845.  
  846.         │7│6│5│4│3│2│1│0│ byte 0B
  847.          │ │ │ │ │ │ │ └─── read only
  848.          │ │ │ │ │ │ └──── hidden
  849.          │ │ │ │ │ └───── system
  850.          │ │ │ │ └────── volume label
  851.          │ │ │ └─────── subdirectory
  852.          │ │ └──────── archive
  853.          └─┴───────── unused
  854.  
  855.     0C-15  Reserved by DOS
  856.     16-17  Time the file was created or last updated:
  857.  
  858.         │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ 17,16
  859.          │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─ seconds/2
  860.          │ │ │ │ │ └─┴─┴─┴─┴─┴────────── minutes
  861.          └─┴─┴─┴─┴───────────────────── hours
  862.  
  863.     18-19  Date the file was created or last updated:
  864.  
  865.         │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ 19,18
  866.          │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─ day 1-31
  867.          │ │ │ │ │ │ │ └─┴─┴─┴────────── month 1-12
  868.          └─┴─┴─┴─┴─┴─┴───────────────── year + 1980
  869.  
  870.     1A-1B  Starting cluster number of the first file cluster
  871.     1C-1F  File size in bytes (low order first)
  872.  
  873. :DBT:Disk Base Table
  874. ^DBT - Disk Base Table    (BIOS INT 13)
  875.  
  876. %     Offset Size        Description
  877.  
  878.     00   byte  specify byte 1; step-rate time, head unload time
  879.     01   byte  specify byte 2; head load time, DMA mode
  880.     02   byte  timer ticks to wait before disk motor shutoff
  881.     03   byte  bytes per sector code:
  882.  
  883.             0 - 128 bytes    2 - 512 bytes
  884.             1 - 256 bytes    3 - 1024 bytes
  885.  
  886.     04   byte  sectors per track (last sector number)
  887.     05   byte  inter-block gap length/gap between sectors
  888.     06   byte  data length, if sector length not specified
  889.     07   byte  gap length between sectors for format
  890.     08   byte  fill byte for formatted sectors
  891.     09   byte  head settle time in milliseconds
  892.     0A   byte  motor startup time in eighths of a second
  893.  
  894. :DTA:Disk Transfer Area
  895. ^DTA - Disk Transfer Area  (partially undocumented)
  896.  
  897.     DTA contains data, of which the first 21 bytes (00-15h) are known
  898.     as being "reserved for DOS use on subsequent find next calls"
  899.  
  900. %     Offset Size       Description
  901.  
  902.     00   byte    attribute of search (undocumented)
  903.     01   byte    drive used in search  (undocumented)
  904.     02  11bytes    search name used (undocumented)
  905.     0D   word    directory entry number (0 based, DOS 3.x+, undoc.)
  906.     0F   word    starting cluster number of current directory
  907.             zero for root directory    (DOS 3.x+, undocumented)
  908.     11   word    reserved (undocumented)
  909.     13   word    starting cluster number of current directory
  910.             zero for root directory    (DOS 2.x+, undocumented)
  911.     15   byte    attribute of matching file
  912.     16   word    file time  (see ~FILE ATTRIBUTES~)
  913.     18   word    file date  (see FILE ATTRIBUTES)
  914.     1A   word    file size
  915.     1E 13bytes    ASCIIZ filename and extension in the form NAME.EXT
  916.             with blanks stripped
  917.  
  918.  
  919.     - fields of DTA change dependent upon function call in progress
  920.     - the ~DTA~ cannot span a 64K segment boundary
  921.     - for compatibility with CP/M the default DTA is at offset 80h
  922.       in the ~PSP~;  this area is also used for the command tail. To
  923.       avoid collision, set another DTA (INT 21,1A) or preserve the
  924.       command tail before using ~FCB~ function calls
  925.  
  926.     - see  ~INT 21,4E~  ~INT 21,1A~  ~INT 21,2F~
  927.  
  928. :DOS error codes:extended errors
  929. ^DOS Error Codes
  930.  
  931.     Of the following error codes, only error codes 1-12 are
  932.     returned in AX upon exit from interrupt 21 or 24;  The rest
  933.     are obtained by issuing the "get extended error" function
  934.     call;  see ~INT 21,59~
  935.  
  936.     01  Invalid function number
  937.     02  File not found
  938.     03  Path not found
  939.     04  Too many open files (no handles left)
  940.     05  Access denied
  941.     06  Invalid handle
  942.     07  Memory control blocks destroyed
  943.     08  Insufficient memory
  944.     09  Invalid memory block address
  945.     0A  Invalid environment
  946.     0B  Invalid format
  947.     0C  Invalid access mode (open mode is invalid)
  948.     0D  Invalid data
  949.     0E  Reserved
  950.     0F  Invalid drive specified
  951.     10  Attempt to remove current directory
  952.     11  Not same device
  953.     12  No more files
  954.     13  Attempt to write on a write-protected diskette
  955.     14  Unknown unit
  956.     15  Drive not ready
  957.     16  Unknown command
  958.     17  CRC error
  959.     18  Bad request structure length
  960.     19  Seek error
  961.     1A  Unknown media type
  962.     1B  Sector not found
  963.     1C  Printer out of paper
  964.     1D  Write fault
  965.     1E  Read fault
  966.     1F  General failure
  967.     20  Sharing violation
  968.     21  Lock violation
  969.     22  Invalid disk change
  970.     23  FCB unavailable
  971.     24  Sharing buffer overflow
  972.     25  Reserved
  973.     26  Unable to complete file operation (DOS 4.x)
  974.     27-31 Reserved
  975.     32  Network request not supported
  976.     33  Remote computer not listening
  977.     34  Duplicate name on network
  978.     35  Network name not found
  979.     36  Network busy
  980.     37  Network device no longer exists
  981.     38  NetBIOS command limit exceeded
  982.     39  Network adapter error
  983.     3A  Incorrect network response
  984.     3B  Unexpected network error
  985.     3C  Incompatible remote adapter
  986.     3D  Print queue full
  987.     3E  No space for print file
  988.     3F  Print file deleted
  989.     40  Network name deleted
  990.     41  Access denied
  991.     42  Network device type incorrect
  992.     43  Network name not found
  993.     44  Network name limit exceeded
  994.     45  NetBIOS session limit exceeded
  995.     46  Temporarily paused
  996.     47  Network request not accepted
  997.     48  Print or disk redirection is paused
  998.     49-4F Reserved
  999.     50  File already exists
  1000.     51  Reserved
  1001.     52  Cannot make directory entry
  1002.     53  Fail on INT 24
  1003.     54  Too many redirections
  1004.     55  Duplicate redirection
  1005.     56  Invalid password
  1006.     57  Invalid parameter
  1007.     58  Network device fault
  1008.     59  Function not supported by network (DOS 4.x)
  1009.     5A  Required system component not installed (DOS 4.x)
  1010.  
  1011.  
  1012. ^DOS Error Code/Classes
  1013.  
  1014. %    Error Classes
  1015.  
  1016.     01  Out of resource, out of space, channel, etc
  1017.     02  Temporary situation, not an error, ex: file lock
  1018.     03  Authorization, permission denied
  1019.     04  Internal, system detected internal error
  1020.     05  Hardware failure, serious problem related to hardware
  1021.     06  System failure, ex: invalid configuration
  1022.     07  Application error, inconsistent request
  1023.     08  Not found, file/item not found
  1024.     09  Bad format, file/item in invalid format
  1025.     0A  Locked, file/item interlocked
  1026.     0B  Media failure, ECC/CRC error, wrong or bad disk
  1027.     0C  Already exists, collision with existing item
  1028.     0D  Unknown, classification doesn't exist or is inappropriate
  1029.  
  1030.  
  1031. ^DOS Error Code/Action Codes and Locus
  1032.  
  1033. %    Error Action Codes  (in BL)
  1034.  
  1035.     01  retry, attempt a few more times and re-prompt
  1036.     02  delay retry, retry a few more times after a pause
  1037.     03  re-enter input, prompt user to re-enter input
  1038.     04  abort with cleanup, orderly abort and shutdown
  1039.     05  immediate abort, exit immediately without cleanup
  1040.     06  ignore error
  1041.     07  user intervention, retry after user fixes the problem
  1042.  
  1043. %    Error Locus (in CH)
  1044.  
  1045.     01  unknown
  1046.     02  block device
  1047.     03  network
  1048.     04  serial device
  1049.     05  memory
  1050.  
  1051. :DOS versions:version
  1052. ^VERSION - Versions of DOS
  1053.  
  1054. %     Version    Date        Changes
  1055.  
  1056.     PC-DOS 1.0   Oct 1981  original release, single sided drive
  1057.     PC-DOS 1.1   Jun 1982  bugfix, double sided drive support
  1058.     MS-DOS 1.25  Jun 1982  for early compatibles
  1059.     PC-DOS 2.0   Mar 1983  PC/XT, added (hard drive &UNIX features)
  1060.     PC-DOS 2.1   Oct 1983  PCjr & portable mods, fixes for 2.0
  1061.     MS-DOS 2.11  Oct 1983  compatible equivalent to 2.1
  1062.     PC-DOS 3.0   Aug 1984  support for 1.2 Mb drive (AT)
  1063.     PC-DOS 3.1   Nov 1984  added network support, fixes for 3.0
  1064.     MS-DOS 2.25  Oct 1985  compatible; foreign language support
  1065.     PC-DOS 3.2   Jul 1986  720k 3½" drive support for Convertible
  1066.     MS-DOS 3.2   Jul 1986
  1067.     MS-DOS 3.21  May 1987
  1068.     MS-DOS 3.3   Jul 1987
  1069.     PC-DOS 3.3   Apr 1987  PS/2, 1.44 disk support, mult. partitions
  1070.     MS-DOS 3.30a Feb 1988
  1071.     CPQ-DOS 3.31 Oct 1988  Compaq DOS for disk partitions > 32MB
  1072.     PC-DOS 4.00  Aug 1988  Larger DOS partitions, EMS support (bugs)
  1073.     MS-DOS 4.00  Oct 1988
  1074.     MS-DOS 4.01  Nov 1988
  1075.     MS-DOS 4.01a Apr 1989
  1076.     PC-DOS 4.01  ??? ????  Fixes for major bugs in 4.0
  1077.  
  1078.  
  1079.     - release dates vary between OEM versions
  1080.     - IBM was supposedly responsible for most changes in DOS 4.x
  1081.     - DOS 4.01 reports version 4.0, except in some vendor versions
  1082.     - DOS 5.0 is primarily a Microsoft developed version
  1083.  
  1084. :drive parameter tbl:disk parameter table:DPB:DPT
  1085. ^DPT/DPB - Drive Parameter Table / Disk Parameter Block
  1086.  
  1087. %     Offset Size        Description
  1088.  
  1089.     00   byte    drive (0 = A, 1 = B)
  1090.     01   byte    unit within device, usually equals drive (ramdisk=0)
  1091.     02   word    bytes per sector
  1092.     04   byte    sectors per cluster minus 1
  1093.     05   byte    sectors per cluster (times to shift left or x2)
  1094.     06   word    number of sectors before FAT (boot sectors)
  1095.     08   byte    number of ~FAT~ copies
  1096.     09   word    number of root directory entries
  1097.     0B   word    number of first data sector
  1098.     0D   word    total number of clusters plus 1
  1099.     0F   byte    number of sectors used by first FAT
  1100.  
  1101. %    The following fields are DOS version dependant
  1102.  
  1103.     10   word    number of first sector in root directory
  1104.     12   dword    far pointer to current disk device header
  1105.     16   byte    media descriptor byte (see ~MEDIA DESCRIPTOR~)
  1106.     17   byte    zero if disk accessed, (default=FF, must rebuild ~DPB~)
  1107.     18   dword    far pointer to next drive parameter table; offset
  1108.             is set to FFFFh if last block in chain
  1109.     1C   word    current directory cluster number; 0=root
  1110.     1E  64bytes    ASCIIZ current working directory
  1111.  
  1112.  
  1113. ^Fields differing in DOS 3.x
  1114.  
  1115. %     Offset Size        Description
  1116.     1C   word    starting cluster for free space search
  1117.     1E  64bytes    number of free clusters; FFFFh = unknown
  1118.  
  1119.  
  1120. ^Fields differing in DOS 4.x
  1121.  
  1122. %     Offset Size        Description
  1123.     11   word    first sector of root directory
  1124.     13   dword    far pointer to current disk device header
  1125.     17   byte    media descriptor byte (see ~MEDIA DESCRIPTOR~)
  1126.     18   byte    zero if disk accessed, (default=FF, must rebuild ~DPB~)
  1127.     19   dword    pointer to next drive parameter table; offset
  1128.             is set to FFFFh if last block in chain
  1129.     1D   word    starting cluster for free space search
  1130.     1F   word    number of free clusters, FFFFh = unknown
  1131.  
  1132.  
  1133.     - ~INT 21,32~ which is used to read this data resets accessed byte at
  1134.       offset 17h or 18h (depending on DOS version)
  1135.     - dword at offset 12h & 13h aren't supported in OS/2 compatability box
  1136.     - sector references are DOS logical sectors
  1137.     - see    ~Disk Base Table~  ~BPB~  ~INT 21,1F~  ~INT 21,32~
  1138. :drive status data:disk status data:diskette status data
  1139. ^Drive Status Bytes Found in BIOS Data Area
  1140.  
  1141. %        Drive recalibration status (at 40:3E)
  1142.  
  1143.         │7│6│5│4│3│2│1│0│ byte at 40:3E
  1144.          │ │ │ │ │ │ │ └─── 1=recalibrate drive 0
  1145.          │ │ │ │ │ │ └──── 1=recalibrate drive 1
  1146.          │ │ │ │ │ └───── 1=recalibrate drive 2
  1147.          │ │ │ │ └────── 1=recalibrate drive 3
  1148.          │ └─┴─┴─────── unused
  1149.          └──────────── 1=working interrupt flag
  1150.  
  1151. %        Diskette motor status
  1152.  
  1153.         │7│6│5│4│3│2│1│0│ byte at 40:3F
  1154.          │ │ │ │ │ │ │ └─── 1=drive 0 motor on
  1155.          │ │ │ │ │ │ └──── 1=drive 1 motor on
  1156.          │ │ │ │ │ └───── 1=drive 2 motor on
  1157.          │ │ │ │ └────── 1=drive 3 motor on
  1158.          │ └─┴─┴─────── unused
  1159.          └──────────── 1=write operation
  1160.  
  1161. %        Disk Status Byte
  1162.  
  1163.         │7│6│5│4│3│2│1│0│ byte at 40:41
  1164.          │ │ │ │ │ │ │ └─── invalid diskette command
  1165.          │ │ │ │ │ │ └──── diskette address mark not found
  1166.          │ │ │ │ │ └───── sector not found
  1167.          │ │ │ │ └────── diskette DMA error
  1168.          │ │ │ └─────── CRC check / data error
  1169.          │ │ └──────── diskette controller failure
  1170.          │ └───────── seek to track failed
  1171.          └────────── diskette time-out
  1172.  
  1173. %        Last diskette data rate selected
  1174.  
  1175.         │7│6│5│4│3│2│1│0│ byte at 40:8B
  1176.          │ │ │ │ └─┴─┴─┴─── step rate time selected (see below)
  1177.          └─┴─┴─┴────────── data rate selected (see below)
  1178.  
  1179. %        Bits
  1180. %         76  Diskette Data Rate Selected
  1181.          00  500K bps
  1182.          01  300K bps
  1183.          10  250K bps
  1184.          11  reserved
  1185.  
  1186. %        Bits
  1187. %         54  Diskette Step Rate Time Selected
  1188.          00  step rate time of 0C
  1189.          01  step rate time of 0D
  1190.          10  step rate time of 0A
  1191.          11  reserved
  1192.  
  1193. %        Media state for fixed drives (bytes at 40:90-93)
  1194.  
  1195.         │7│6│5│4│3│2│1│0│ bytes at 40:90-40:93
  1196.          │ │ │ │ │ └─┴─┴─── reserved (set to 1)
  1197.          │ │ │ │ └──────── reserved
  1198.          │ │ │ └───────── 0=media/drive unestablished
  1199.          │ │ └────────── reserved
  1200.          └─┴─────────── data rate (see below)
  1201.  
  1202. %        Bits
  1203. %         76  Fixed Disk Data Rate Selected
  1204.          00  500K bps
  1205.          01  reserved
  1206.          10  250K bps
  1207.          11  reserved
  1208.  
  1209.     - not all OEM's implemented these bytes identically.  Some are
  1210.       also AT specific.
  1211.  
  1212. :EXE file header:.EXE
  1213. ^.EXE - DOS EXE File Structure
  1214.  
  1215. %     Offset Size         Description
  1216.  
  1217.     00   word  "MZ" - Link file .EXE signature (Mark Zbikowski?)
  1218.     02   word  length of image mod 512
  1219.     04   word  size of file in 512 byte pages
  1220.     06   word  number of relocation items following header
  1221.     08   word  size of header in 16 byte paragraphs, used to locate
  1222.              the beginning of the load module
  1223.     0A   word  min # of paragraphs needed to run program
  1224.     0C   word  max # of paragraphs the program would like
  1225.     0E   word  offset in load module of stack segment (in paras)
  1226.     10   word  initial SP value to be loaded
  1227.     12   word  negative checksum of pgm used while by EXEC loads pgm
  1228.     14   word  program entry point, (initial IP value)
  1229.     16   word  offset in load module of the code segment (in paras)
  1230.     18   word  offset in .EXE file of first relocation item
  1231.     1A   word  overlay number (0 for root program)
  1232.  
  1233.     - relocation table and the program load module follow the header
  1234.     - relocation entries are 32 bit values representing the offset
  1235.       into the load module needing patched
  1236.     - once the relocatable item is found, the CS register is added to
  1237.       the value found at the calculated offset
  1238.  
  1239. %    Registers at load time of the EXE file are as follows:
  1240.  
  1241.     AX:    contains number of characters in command tail, or 0
  1242.     BX:CX    32 bit value indicating the load module memory size
  1243.     DX    zero
  1244.     SS:SP    set to stack segment if defined else,  SS = CS and
  1245.         SP=FFFFh or top of memory.
  1246.     DS    set to segment address of EXE header
  1247.     ES    set to segment address of EXE header
  1248.     CS:IP    far address of program entry point, (label on "END"
  1249.         statement of program)
  1250.  
  1251. :EBDA:extended BIOS
  1252. ^EBDA - Extended BIOS Data Area EBDA (PS/2)
  1253.  
  1254. %     Offset     Size         Description
  1255.  
  1256.     00     word       number of bytes allocated to EBDA in Kbytes
  1257.     01-21     21bytes   reserved
  1258.     22     dword       device driver far call pointer
  1259.     26     byte       pointing device flag (1st byte, see below)
  1260.     27     byte       pointing device flag (2nd byte, see below)
  1261.     28-2F     8 bytes   reserved
  1262.  
  1263.  
  1264. %        Pointing Device Flag Byte 1
  1265.  
  1266.         │7│6│5│4│3│2│1│0│ Offset 26
  1267.          │ │ │ │ │ └─┴─┴─── index count
  1268.          │ │ │ │ └──────── reserved (0)
  1269.          │ │ │ └───────── error
  1270.          │ │ └────────── acknowledge
  1271.          │ └─────────── resend
  1272.          └──────────── command in progress
  1273.  
  1274. %        Pointing Device Flag Byte 2
  1275.  
  1276.         │7│6│5│4│3│2│1│0│ Offset 27
  1277.          │ │ │ │ │ └─┴─┴─── package size
  1278.          │ └─┴─┴─┴──────── reserved
  1279.          └─────────────── device driver far call flag
  1280.  
  1281.  
  1282.     - EBDA is located in highest memory just under 640K on PS/2
  1283.     - word at ~BIOS Data Area~ 40:0E is segment address of EBDA
  1284.  
  1285. :FAT:File Allocation Table
  1286. ^FAT - File Allocation Table
  1287.  
  1288. %    12 Bit              Meaning            16 Bit
  1289.  
  1290.      000             free space             0000
  1291.      FF1-FF7          bad track marking             FFF1-FFF7
  1292.      FF8-FFE   may be used to mark end of a file chain   FFF8-FFFE
  1293.      FFF       standard marker for end of a file chain   FFFF
  1294.  
  1295.  
  1296.     - the FAT is implemented as an array containing a linked list
  1297.       for each file;  the files directory entry has a pointer to the
  1298.       first cluster which contains the cluster number of the next
  1299.       cluster in the chain until the pointer contained is FFFh
  1300.       (12 bit FAT) and FFFFh (16 bit FAT) marking end of file
  1301.     - DOS maintains two copies of the FAT, but does not use the
  1302.       second copy for anything other than a mirror image of the
  1303.       first;  CHKDSK doesn't even read the second FAT
  1304.     - disks with FF1h clusters and above use 16 bit FAT tables, disk
  1305.       with less use 12 bit FAT tables
  1306.     - DOS 4.x did not change the size of the cluster number as some
  1307.       suggest, but instead increased the size of the sector number
  1308.     - bytes 0 of the FAT contains the Media Descriptor Byte
  1309.  
  1310.  
  1311. ^Calculating 12 bit FAT Entries
  1312.  
  1313.     1. Get starting cluster from directory entry.
  1314.  
  1315.     2. Multiply the cluster number just used by 1.5
  1316.  
  1317.     3. The whole part of the product is the offset into the FAT,
  1318.        of the entry that maps to the cluster in the directory.
  1319.        This entry contains the number of the next cluster.
  1320.  
  1321.     4. Move the word at the calculated FAT into a register.
  1322.  
  1323.     5. If the last cluster used was an even number, keep the low order
  1324.        12 bits of the register, otherwise, keep the high order 12 bits.
  1325.  
  1326.     6. If the resultant 12 bits are (0FF8h-0FFFh) no more clusters
  1327.        are in the file.  Otherwise, the next 12 bits contain the
  1328.        cluster number of the next cluster in the file.
  1329.  
  1330.  
  1331. ^Calculating 16 Bit FAT Entries
  1332.  
  1333.     1. Get the starting cluster of the file from the directory.
  1334.  
  1335.     2. Multiply the cluster number found by 2.
  1336.  
  1337.     3. Load the word at the calculated FAT offset into a register.
  1338.  
  1339.     4. If the 16 bits are (0FFF8h-0FFFFh) no more clusters are in
  1340.        the file. Otherwise, the 16 bits contain the cluster number
  1341.        of the next cluster in the file.
  1342.  
  1343.  
  1344.     To convert the cluster to a logical sector number (relative
  1345.     sector, similar to that used by DEBUG, int 25h and 26h):
  1346.  
  1347.     1. Subtract 2 from the cluster number
  1348.     2. Multiply the result by the number of sectors per cluster.
  1349.     3. Add the logical sector number of the beginning of the data area.
  1350.  
  1351.  
  1352.     - see  ~MEDIA DESCRIPTOR~
  1353.  
  1354. :FCB:File Control Block
  1355. ^FCB - Standard DOS File Control Block
  1356.  
  1357. %     Offset Size        Description
  1358.  
  1359.     -7   byte    if FF this is an extended FCB  ╪
  1360.     -6  5bytes    reserved  ╪ 
  1361.     -1   byte    file attribute if extended FCB    ╪
  1362.     00   byte    drive number (0 for default drive, 1=A:, 2=B:, ...)
  1363.     01  8bytes    filename, left justified with trailing blanks
  1364.     09  3bytes    filename extension, left justified w/blanks
  1365.     0C   word    current block number relative to beginning of the
  1366.             file, starting with zero
  1367.     0E   word    logical record size in bytes
  1368.     10   dword    file size in bytes
  1369.     14   word    date the file was created or last updated
  1370.  
  1371.         │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ 15,14 (Intel reverse order)
  1372.          │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─ day 1-31
  1373.          │ │ │ │ │ │ │ └─┴─┴─┴────────── month 1-12
  1374.          └─┴─┴─┴─┴─┴─┴───────────────── year + 1980
  1375.  
  1376.     16   word    time of last write
  1377.  
  1378.         │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ 17,16 (Intel reverse order)
  1379.          │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴── secs in 2 second increments
  1380.          │ │ │ │ │ └─┴─┴─┴─┴─┴─────────── minutes (0-59)
  1381.          └─┴─┴─┴─┴────────────────────── hours (0-23)
  1382.  
  1383.     18  8bytes    see below for version specific information  ╪
  1384.     1A   dword    address of device header if character device  ╪
  1385.     20   byte    current relative record number within current BLOCK
  1386.     21   dword    relative record number relative to the beginning of
  1387.             the file, starting with zero; high bit omitted if
  1388.             record length is 64 bytes
  1389.  
  1390.  
  1391. ^DOS 2.x Values for reserved fields at offsets 18h-1Ah    ╪
  1392.  
  1393. %     Offset Size        Description
  1394.     18   byte    │7│6│5│4│3│2│1│0│
  1395.              │ │ └─┴─┴─┴─┴─┴─── unknown
  1396.              │ └────────────── 1 = open
  1397.              └─────────────── 1 = logical device
  1398.  
  1399.     19   word       starting cluster number  ╪
  1400.     
  1401.  
  1402. ^DOS 3.x Values for reserved fields at offsets 18h-19h    ╪
  1403.  
  1404. %     Offset Size        Description
  1405.     18   byte    System File Table (SFT) entry for file    ╪
  1406.     19   byte    attributes  ╪
  1407.  
  1408.             │7│6│5│4│3│2│1│0│  attributes
  1409.              │ │ └─┴─┴─┴─┴─┴──── unknown
  1410.              └─┴─ share status  
  1411.              
  1412.             00 = SHARE not loaded block device
  1413.             01 = SHARE not loaded characted device
  1414.             10 = SHARE loaded, remote file
  1415.             11 = SHARE loaded local file
  1416.  
  1417.  
  1418. ^DOS 3.x with SHARE, local file reserved offsets 1Ah-1Eh  ╪
  1419.  
  1420. %     Offset Size        Description
  1421.     1A   word    starting cluster number
  1422.     1C   word    offset within SHARE of sharing record
  1423.     1E   byte    file attribute
  1424.  
  1425.  
  1426. ^DOS 3.x with SHARE, remote file reserved offsets 1Ah-1Eh  ╪
  1427.  
  1428. %     Offset Size        Description
  1429.     1A   word    sector number containing directory entry
  1430.     1C   word    last cluster accessed relative to beginning of file
  1431.     1E   byte    absolute cluster number of last cluster accessed
  1432.  
  1433.  
  1434. ^DOS 3.x without SHARE reserved offsets 1Ah-1Fh  ╪
  1435.  
  1436. %     Offset Size        Description
  1437.     1A   byte    ((device attribute word low byte) & 0Ch) || (open mode)
  1438.     1B   word    starting cluster number
  1439.     1D   word    sector number containing directory entry
  1440.     1F   byte    number of directory entry within sector
  1441.  
  1442.  
  1443. %    The following are FCB related DOS functions:
  1444.  
  1445.     ~INT 21,F~   Open file using FCB
  1446.     ~INT 21,10~  Close file using FCB
  1447.     ~INT 21,11~  Search for first entry using FCB
  1448.     ~INT 21,12~  Search for next entry using FCB
  1449.     ~INT 21,13~  Delete file using FCB
  1450.     ~INT 21,14~  Sequential read using FCB
  1451.     ~INT 21,15~  Sequential write using FCB
  1452.     ~INT 21,16~  Create a file using FCB
  1453.     ~INT 21,17~  Rename file using FCB
  1454.     ~INT 21,21~  Random read using FCB
  1455.     ~INT 21,22~  Random write using FCB
  1456.     ~INT 21,23~  Get file size using FCB
  1457.     ~INT 21,24~  Set relative record field for FCB
  1458.     ~INT 21,27~  Random block read using FCB
  1459.     ~INT 21,28~  Random block write using FCB
  1460.     ~INT 21,29~  Parse filename for FCB
  1461.  
  1462.  
  1463.     ╪  see ~Bibliography~ reference to "Undocumented DOS"
  1464.  
  1465.     - see    ~XFCB~   ~INT 21,52~
  1466. :file attributes
  1467. ^DOS File Attributes
  1468.  
  1469. %    Directory Attribute Flags
  1470.  
  1471.     │7│6│5│4│3│2│1│0│ Directory Attribute Flags
  1472.      │ │ │ │ │ │ │ └─── 1 = read only
  1473.      │ │ │ │ │ │ └──── 1 = hidden
  1474.      │ │ │ │ │ └───── 1 = system
  1475.      │ │ │ │ └────── 1 = volume label  (exclusive)
  1476.      │ │ │ └─────── 1 = subdirectory
  1477.      │ │ └──────── 1 = archive
  1478.      └─┴───────── unused
  1479.  
  1480. %    Directory Time Format
  1481.  
  1482.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ Directory Time Format
  1483.      │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─── seconds (2 second increments)
  1484.      │ │ │ │ │ └─┴─┴─┴─┴─┴──────────── minutes (0-59)
  1485.      └─┴─┴─┴─┴─────────────────────── hours (0-23)
  1486.  
  1487. %    Directory Date Format
  1488.  
  1489.     │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ Directory Date Format
  1490.      │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─── Day (1-31)
  1491.      │ │ │ │ │ │ │ └─┴─┴─┴──────────── Month (1-12)
  1492.      └─┴─┴─┴─┴─┴─┴─────────────────── Year (less 1980)
  1493.  
  1494.  
  1495.     - with respect to the ~findfirst~() and ~findnext~() functions normal
  1496.       files are always included along with the requested attributes
  1497.       except when the LABEL attribute is requested.  It's up to the
  1498.       programmer to determine which files are match the requested
  1499.       attributes.
  1500. :file handles:default handles:handles
  1501. ^DOS Default/Predefined File Handles
  1502.  
  1503.      0 - Standard Input Device - can be redirected (STDIN)
  1504.      1 - Standard Output Device - can be redirected (STDOUT)
  1505.      2 - Standard Error Device - can be redirected (STDERR)
  1506.      3 - Standard Auxiliary Device (STDAUX)
  1507.      4 - Standard Printer Device (STDPRN)
  1508.  
  1509.  
  1510. %See the following  INT 21h  Handle related function calls:
  1511.  
  1512.     ~INT 21,3C~  Create file using handle
  1513.     ~INT 21,3D~  Open file using handle
  1514.     ~INT 21,3E~  Close file using handle
  1515.     ~INT 21,3F~  Read file or device using handle
  1516.     ~INT 21,40~  Write file or device using handle
  1517.     ~INT 21,41~  Delete file
  1518.     ~INT 21,42~  Move file pointer using handle
  1519.     ~INT 21,43~  Change file mode
  1520.     ~INT 21,45~  Duplicate file handle
  1521.     ~INT 21,46~  Force duplicate file handle
  1522.     ~INT 21,56~  Rename file
  1523.     ~INT 21,57~  Get/set file date and time using handle
  1524.     ~INT 21,5A~  Create temporary file (3.x+)
  1525.     ~INT 21,5B~  Create new file (3.x+)
  1526.     ~INT 21,67~  Set handle count (3.3+)
  1527.     ~INT 21,68~  Flush buffer (3.3+)
  1528.  
  1529.  
  1530.     - STDIN, STDOUT and STDERR can be redirected
  1531.     - maximum number of files available to all DOS processes at one
  1532.       time is defined by the FILES=N statement of ~CONFIG.SYS~
  1533.     - maximum number of files available to an application is N-3 where
  1534.       N is derived from the CONFIG.SYS FILES=N statement minus the
  1535.       count of handles used by other processes
  1536.     - ~INT 21,67~ can be used in DOS 3.3+ to increase the number of file
  1537.       handles for an application to greater than 20;  the max handle
  1538.       count is still limited by the value of FILES= in CONFIG.SYS file
  1539.     - An application can increase the maximum allowed file handles in
  1540.       DOS 3.0-3.2 by copying the open file table located through offset
  1541.       34h in the ~PSP~ to another location.  All unopened slots must be
  1542.       initialized to FF and the values at PSP offsets 32h and 34h must
  1543.       be updated to reflect the new values.
  1544.     - see    ~SFT~   ~INT 21~   ~INT 21,52~   ~INT 21,67~
  1545. :float formats:floating point:real numbers
  1546. ^Floating Point Formats
  1547.  
  1548. %    IEEE 4 byte real
  1549.  
  1550.     31 30     23 22                  0
  1551.     ┌─┬────────┬──────────────────────────┐
  1552.     │s│ 8 bits │msb   23 bit mantissa  lsb│
  1553.     └─┴────────┴──────────────────────────┘
  1554.      │    │         └────────────────  mantissa
  1555.      │    └────────────────────────────────  biased exponent (7fh)
  1556.      └─────────────────────────────────────  sign bit
  1557.  
  1558. %    IEEE 8 byte real
  1559.  
  1560.     63 62       52 51                  0
  1561.     ┌─┬──────────┬────────────────────────────────────┐
  1562.     │s│  11 bits │msb     52 bit mantissa       lsb│
  1563.     └─┴──────────┴────────────────────────────────────┘
  1564.      │    │         └────────────────  mantissa
  1565.      │    └────────────────────────────────  biased exponent (3FFh)
  1566.      └─────────────────────────────────────  sign bit
  1567.  
  1568. %    Microsoft 4 byte real
  1569.  
  1570.     31     24 23 22                  0
  1571.     ┌────────┬─┬──────────────────────────┐
  1572.     │ 8 bits │s│msb  23 bit mantissa   lsb│
  1573.     └────────┴─┴──────────────────────────┘
  1574.          │      │         └────────────────  mantissa
  1575.          │      └────────────────────────────  sign bit
  1576.          └──────────────────────────────  biased exponent (81h)
  1577.  
  1578. %    Microsoft 8 byte real (see note below)
  1579.  
  1580.     63    56 55 54                        0
  1581.     ┌───────┬─┬────────────────────────────────────┐
  1582.     │ 8bits │s│msb        52 bit mantissa        lsb│
  1583.     └───────┴─┴────────────────────────────────────┘
  1584.         │     │              └────────────  mantissa
  1585.         │     └─────────────────────────────  sign bit
  1586.         └───────────────────────────  biased exponent (401h, see below)
  1587.  
  1588. %    IEEE 10 byte real (temporary real)
  1589.  
  1590.     79 78        64 63 62                     0
  1591.     ┌─┬───────────┬─┬────────────────────────────────────────┐
  1592.     │s│  15 bits  │1│msb          63 bit mantissa          lsb│
  1593.     └─┴───────────┴─┴────────────────────────────────────────┘
  1594.      │    │      │            └─────  mantissa
  1595.      │    │      └────────────────────────  first mantissa bit
  1596.      │    └─────────────────────────────    biased exponent (3FFFh)
  1597.      └──────────────────────────────────  sign bit
  1598.  
  1599. %    Turbo Pascal 6 byte real
  1600.  
  1601.     47     40 39 38                    0
  1602.     ┌────────┬─┬────────────────────────────────────┐
  1603.     │ 8 bits │s│msb        39 bit mantissa         lsb│
  1604.     └────────┴─┴────────────────────────────────────┘
  1605.          │      │             └────────────  mantissa
  1606.          │      └─────────────────────────────  sign bit
  1607.          └────────────────────────────────  biased exponent (80h)
  1608.  
  1609. %    Microsoft Fortran Complex number
  1610.     ┌──────────────────────────┬─────────────────────────────┐
  1611.     │   Float Real component   │  Float Imaginary component  │
  1612.     └──────────────────────────┴─────────────────────────────┘
  1613.     (each component is either 8 or 16 byte IEEE real)
  1614.  
  1615.  
  1616.     - sign bit representation:  0 is positive  and    1 is negative
  1617.     - in all float formats except the IEEE 10 byte real, the
  1618.       mantissa is stored without most significant bit; since
  1619.       the state of this bit is known to be set, it is not
  1620.       included and the exponent is adjusted accordingly
  1621.     - all formats use binary float representation
  1622.     - memory representation uses 80x86 reverse byte/word order.
  1623.     - Microsoft languages use the IEEE real formats;  BASIC is the
  1624.       only normal user of the Microsoft float format
  1625.     - Microsoft 8 byte real format has not been verified;  several
  1626.       Microsoft publications show an 8 bit exponent instead of 11 bits
  1627.       and state the BIAS is 401h;  the discrepancy is that 8 bits can't
  1628.       hold the value 401h (requires 11 bits)
  1629.  
  1630.  
  1631. %    True exponent is the exponent value minus the following bias:
  1632.  
  1633.     81h for Microsoft 4 byte real
  1634.     401h for Microsoft 8 byte real
  1635.     7Fh for IEEE 4 byte real
  1636.     3FFh for IEEE 8 byte real
  1637.     80h for Turbo Pascal 6 byte real
  1638.  
  1639. %         Size           Range         Significant digits
  1640.  
  1641.     4 byte real      8.43x10E-37 to 3.37x10E38        6-7
  1642.     8 byte real     4.19x10E-307 to 1.67x10E308       15-16
  1643.     10 byte real     3.4x10E-4932 to 1.2x10E4932         19
  1644.  
  1645.  
  1646.     - see    ~dmsbintoieee~()   ~dieeetomsbin~()   ~NUMERIC RANGES~
  1647.  
  1648. :floppy formats:disk formats
  1649. ^Common Floppy Disk Formats
  1650.  
  1651. %           Supporting        ┌────Sectors────┐  Entries
  1652. %      Disk      DOS           per    per  per   per     per   Total
  1653. %      Type     Vers  Sides Trks  TRK    FAT  DIR Cluster DIR  Sectors
  1654.     ─────────────────────────────────────────────────────────────
  1655.  
  1656.     5¼ 160k  (1.0)     1   (40)   8     1    4        1      64     320
  1657.  
  1658.     5¼ 320k  (1.1)     2   (40)   8     1    7        2     112     640
  1659.  
  1660.     5¼ 180k  (2.0)     1   (40)   9     2    4        1      64     360
  1661.  
  1662.     5¼ 360k  (2.0)     2   (40)   9     2    7        2     112     720
  1663.  
  1664.     5¼ 1.2M  (3.0)     2   (80)  15     7   14        1     224    2400
  1665.  
  1666.     3½ 720k  (3.2)     2   (80)   9     3    7        2     112    1440
  1667.  
  1668.     3½ 1.44M (3.3)     2   (80)  18     9   14        1     224    2880
  1669.  
  1670. :ID bytes:machine identificatn
  1671. ^Machine Identification Byte
  1672.  
  1673. %          Model  Sub-Model        Machine
  1674.  
  1675.         FF    ??    Original IBM PC  4/24/81
  1676.             ??    IBM PC    10/19/81
  1677.             ??    IBM PC    10/27/82
  1678.         FE    ??    IBM XT (Original)
  1679.             ??    IBM portable PC
  1680.             ??    Compaq DeskPro
  1681.         FD    ??    PCjr
  1682.         FC    ??    IBM AT (6 MHz)
  1683.             01    IBM AT 3x9 (8 MHz)
  1684.             02    IBM XT 286
  1685.             04    IBM PS/2 Model 50
  1686.             05    IBM PS/2 Model 60
  1687.             0B    IBM PS/1
  1688.         FB    00    IBM 256/640K XT (aka XT/2)
  1689.         FA    00    IBM PS/2 Model 30
  1690.             01    IBM PS/2 Model 25
  1691.         F9    00    IBM PC Convertible
  1692.         F8    00    IBM PS/2 Model 80  (16 MHz)
  1693.             01    IBM PS/2 Model 80  (20 MHz)
  1694.             04    IBM PS/2 Model 70  (20 MHz)
  1695.             09    IBM PS/2 Model 70  (16 MHz)
  1696.         B6    ??    Hewlett Packard 110
  1697.         9A    ??    Compaq Plus
  1698.         86        XT (BIOS 11/82+) & AT (BIOS 1/84+) (see note)
  1699.         80        PC & PCjr (see note)
  1700.         2D    ??    Compaq PC
  1701.  
  1702.  
  1703.     - found at memory location F000:FFFE or via INT 15,C0
  1704.     - model values of 80 & 86 are returned by BIOS versions previous
  1705.       to the PS/2 but after the BIOS dates marked
  1706.  
  1707.     - see    ~INT 15,C0~
  1708.  
  1709. :KB flags:keyboard flags
  1710. ^Keyboard Flags Bytes 0 and 1
  1711.  
  1712.         │7│6│5│4│3│2│1│0│  40:17  Keyboard Flags Byte 0
  1713.          │ │ │ │ │ │ │ └──── right shift key depressed
  1714.          │ │ │ │ │ │ └───── left shift key depressed
  1715.          │ │ │ │ │ └────── CTRL key depressed
  1716.          │ │ │ │ └─────── ALT key depressed
  1717.          │ │ │ └──────── scroll-lock is active
  1718.          │ │ └───────── num-lock is active
  1719.          │ └────────── caps-lock is active
  1720.          └─────────── insert is active
  1721.  
  1722.         │7│6│5│4│3│2│1│0│  40:18  Keyboard Flags Byte 1
  1723.          │ │ │ │ │ │ │ └──── left CTRL key depressed
  1724.          │ │ │ │ │ │ └───── left ALT key depressed
  1725.          │ │ │ │ │ └────── system key depressed and held
  1726.          │ │ │ │ └─────── suspend key has been toggled
  1727.          │ │ │ └──────── scroll lock key is depressed
  1728.          │ │ └───────── num-lock key is depressed
  1729.          │ └────────── caps-lock key is depressed
  1730.          └─────────── insert key is depressed
  1731.  
  1732. ^Keyboard Flags Bytes 2 and 3
  1733.  
  1734.         │7│6│5│4│3│2│1│0│  40:97  LED Indicator Flags
  1735.          │ │ │ │ │ │ │ └──── scroll lock indicator
  1736.          │ │ │ │ │ │ └───── num-lock indicator
  1737.          │ │ │ │ │ └────── caps-lock indicator
  1738.          │ │ │ │ └─────── circus system indicator
  1739.          │ │ │ └──────── ACK received
  1740.          │ │ └───────── re-send received flag
  1741.          │ └────────── mode indicator update
  1742.          └─────────── keyboard transmit error flag
  1743.  
  1744.         │7│6│5│4│3│2│1│0│  40:96  Keyboard Mode/Type
  1745.          │ │ │ │ │ │ │ └──── last code was the E1 hidden code
  1746.          │ │ │ │ │ │ └───── last code was the E0 hidden code
  1747.          │ │ │ │ │ └────── right CTRL key depressed
  1748.          │ │ │ │ └─────── right ALT key depressed
  1749.          │ │ │ └──────── 101/102 enhanced keyboard installed
  1750.          │ │ └───────── force num-lock if Rd ID & KBX
  1751.          │ └────────── last char was first ID char
  1752.          └─────────── read ID in process
  1753.  
  1754.     - see    ~INT 9~  ~BDA~
  1755. :make codes:break codes
  1756. ^INT 9 - Hardware Keyboard Make/Break Codes
  1757.  
  1758. %    Key         Make  Break        Key    Make  Break
  1759.  
  1760.     Backspace     0E    8E            F1    3B    BB
  1761.     Caps Lock     3A    BA            F2    3C    BC
  1762.     Enter          1C    9C            F3    3D    BD
  1763.     Esc          01    81            F4    3E    BE
  1764.     Left Alt      38    B8            F7    41    C1
  1765.     Left Ctrl     1D    9D            F5    3F    BF
  1766.     Left Shift    2A    AA            F6    40    C0
  1767.     Num Lock      45    C5            F8    42    C2
  1768.     Right Shift   36    B6            F9    43    C3
  1769.     Scroll Lock   46    C6            F10    44    C4
  1770.     Space          39    B9            F11    57    D7
  1771.     Sys Req (AT)  54    D4            F12    58    D8
  1772.     Tab          0F    8F
  1773.  
  1774. %            Keypad Keys               Make   Break
  1775.  
  1776.             Keypad 0  (Ins)        52    D2
  1777.             Keypad 1  (End)         4F    CF
  1778.             Keypad 2  (Down arrow)    50    D0
  1779.             Keypad 3  (PgDn)        51    D1
  1780.             Keypad 4  (Left arrow)    4B    CB
  1781.             Keypad 5            4C    CC
  1782.             Keypad 6  (Right arrow)    4D    CD
  1783.             Keypad 7  (Home)        47    C7
  1784.             Keypad 8  (Up arrow)    48    C8
  1785.             Keypad 9  (PgUp)        49    C9
  1786.             Keypad .  (Del)         53    D3
  1787.             Keypad *  (PrtSc)        37    B7
  1788.             Keypad -            4A    CA
  1789.             Keypad +            4E    CE
  1790.  
  1791. %           Key    Make  Break           Key    Make  Break
  1792.  
  1793.         A      1E    9E         N      31    B1
  1794.         B      30    B0         O      18    98
  1795.         C      2E    AE         P      19    99
  1796.         D      20    A0         Q      10    90
  1797.         E      12    92         R      13    93
  1798.         F      21    A1         S      1F    9F
  1799.         G      22    A2         T      14    94
  1800.         H      23    A3         U      16    96
  1801.         I      17    97         V      2F    AF
  1802.         J      24    A4         W      11    91
  1803.         K      25    A5         X      2D    AD
  1804.         L      26    A6         Y      15    95
  1805.         M      32    B2         Z      2C    AC
  1806.  
  1807. %           Key    Make  Break           Key    Make  Break
  1808.  
  1809.         1      02    82         -      0C    8C
  1810.         2      03    83         =      0D    8D
  1811.         3      04    84         [      1A    9A
  1812.         4      05    85         ]      1B    9B
  1813.         5      06    86         ;      27    A7
  1814.         6      07    87         '      28    A8
  1815.         7      08    88         `      29    A9
  1816.         8      09    89         \      2B    AB
  1817.         9      0A    8A         ,      33    B3
  1818.         0      0B    8B         .      34    B4
  1819.                         /      35    B5
  1820.  
  1821. ^Enhanced Keyboard Keys (101/102 keys)
  1822.  
  1823. %    Control Keys          Make          Break
  1824.  
  1825.     Alt-PrtSc (SysReq)      54          D4
  1826.     Ctrl-PrtSc          E0 37       E0 B7
  1827.     Enter              E0 1C       E0 9C
  1828.     PrtSc              E0 2A E0 37      E0 B7 E0 AA
  1829.     Right Alt          E0 38       E0 B8
  1830.     Right Ctrl          E0 1D       E0 9D
  1831.     Shift-PrtSc          E0 37       E0 B7
  1832.     /              E0 35       E0 B5
  1833.     Pause              E1 1D 45 E1 9D C5  (not typematic)
  1834.     Ctrl-Pause (Ctrl-Break)   E0 46 E0 C6         (not typematic)
  1835.  
  1836.     - Keys marked as "not typematic" generate one stream of bytes
  1837.       without corresponding break scan code bytes (actually the
  1838.       break codes are part of the make code).
  1839.  
  1840.  
  1841. %            Normal Mode or
  1842. %            Shift w/Numlock
  1843. %    Key         Make     Break       ┌───── Numlock on ──────┐
  1844. %                          Make        Break
  1845.     Del         E0 53     E0 D3       E0 2A E0 53     E0 D3 E0 AA
  1846.     Down arrow     E0 50     E0 D0       E0 2A E0 50     E0 D0 E0 AA
  1847.     End         E0 4F     E0 CF       E0 2A E0 4F     E0 CF E0 AA
  1848.     Home         E0 47     E0 C7       E0 2A E0 47     E0 C7 E0 AA
  1849.     Ins         E0 52     E0 D2       E0 2A E0 52     E0 D2 E0 AA
  1850.     Left arrow     E0 4B     E0 CB       E0 2A E0 4B     E0 CB E0 AA
  1851.     PgDn         E0 51     E0 D1       E0 2A E0 51     E0 D1 E0 AA
  1852.     PgUp         E0 49     E0 C9       E0 2A E0 49     E0 C9 E0 AA
  1853.     Right arrow     E0 4D     E0 CD       E0 2A E0 4D     E0 CD E0 AA
  1854.     Up arrow     E0 48     E0 C8       E0 2A E0 48     E0 C8 E0 AA
  1855.  
  1856. %    Key          ┌──Left Shift Pressed──┐      ┌──Right Shift Pressed──┐
  1857. %             Make           Break          Make        Break
  1858.     Del          E0 AA E0 53   E0 D3 E0 2A    E0 B6 E0 53     E0 D3 E0 36
  1859.     Down arrow    E0 AA E0 50   E0 D0 E0 2A    E0 B6 E0 50     E0 D0 E0 36
  1860.     End          E0 AA E0 4F   E0 CF E0 2A    E0 B6 E0 4F     E0 CF E0 36
  1861.     Home          E0 AA E0 47   E0 C7 E0 2A    E0 B6 E0 47     E0 C7 E0 36
  1862.     Ins          E0 AA E0 52   E0 D2 E0 2A    E0 B6 E0 52     E0 D2 E0 36
  1863.     Left arrow    E0 AA E0 4B   E0 CB E0 2A    E0 B6 E0 4B     E0 CB E0 36
  1864.     PgDn          E0 AA E0 51   E0 D1 E0 2A    E0 B6 E0 51     E0 D1 E0 36
  1865.     PgUp          E0 AA E0 49   E0 C9 E0 2A    E0 B6 E0 49     E0 C9 E0 36
  1866.     Right arrow   E0 AA E0 4D   E0 CD E0 2A    E0 B6 E0 4D     E0 CD E0 36
  1867.     Up arrow      E0 AA E0 48   E0 C8 E0 2A    E0 B6 E0 48     E0 C8 E0 36
  1868.     /          E0 AA E0 35   E0 B5 E0 2A    E0 B6 E0 35     E0 B5 E0 36
  1869.  
  1870.  
  1871.     - The PS/2 models have three make/break scan code sets.  The first
  1872.       set matches the PC & XT make/break scan code set and is the one
  1873.       listed here.    Scan code sets are selected by writing the value F0
  1874.       to the keyboard via the ~8042~ (port 60h).  The following is a brief
  1875.       description of the scan code sets (see the PS/2 Technical Reference
  1876.       manuals for more information on scan code sets 2 and 3):
  1877.  
  1878.     ∙  set 1, each key has a base scan code.  Some keys generate
  1879.        extra scan codes to generate artificial shift states.  This
  1880.        is similar to the standard scan code set used on the PC and XT.
  1881.     ∙  set 2, each key sends one make scan code and two break scan
  1882.        codes bytes (F0 followed by the make code).    This scan code
  1883.        set is available on the IBM AT also.
  1884.     ∙  set 3, each key sends one make scan code and two break scan
  1885.        codes bytes (F0 followed by the make code) and no keys are
  1886.        altered by Shift/Alt/Ctrl keys.
  1887.     ∙  typematic scan codes are the same as the make scan code
  1888.  
  1889.     - Some Tandy 1000's do not handle Alt key combinations when multiple
  1890.       shift keys are pressed.  The Alt-Shift-H combination loses the Alt.
  1891.     - extended keys like (F11, F12) can only be read with systems that
  1892.       have extended keyboard BIOS support (or ~INT 9~ extensions);  to
  1893.       read these special keys on these systems ~INT 16,10~ must be used
  1894.  
  1895.       - see  ~SCAN CODES~   ~KB FLAGS~  ~KEYBOARD COMMANDS~
  1896. :GDT:Global Descriptor Table
  1897. ^GDT - Global Descriptor Table
  1898.  
  1899. %     Offset Size        Description
  1900.  
  1901.     00  8bytes    dummy, set to 0
  1902.     08  8bytes    ~GDT~ data segment location, set to 0
  1903.     10  8bytes    source GDT pointer
  1904.     18  8bytes    target GDT pointer
  1905.     20  8bytes    pointer to BIOS code segment, set to 0.    used by
  1906.             the BIOS to create protected mode code segment
  1907.     28  8bytes    pointer to BIOS stack segment, set to 0.  Used by
  1908.             the BIOS to create protected mode stack segment
  1909.     30  8bytes    user code segment
  1910.     38  8bytes    temporary BIOS code segment
  1911.  
  1912.  
  1913. %    Source/Target GDT use the following format (offsets 10h and 18h):
  1914.  
  1915. %     Offset Size        Description
  1916.  
  1917.     00   word    Segment limit
  1918.     02  3bytes    24 bit segment physical address
  1919.     05   byte    data access rights, set to 93h
  1920.     06   word    reserved word, must be 0
  1921.  
  1922.     - see    ~LGDT~  ~SGDT~
  1923.  
  1924. :media descriptor byte
  1925. ^Media Descriptor Byte
  1926.  
  1927. %    Media Descriptor Byte Layout:
  1928.  
  1929.     │7│6│5│4│3│2│1│0│ IBM Media Descriptor Byte
  1930.      │ │ │ │ │ │ │ └─── 1 = 2 sided, 0 = not 2 sided
  1931.      │ │ │ │ │ │ └──── 1 = 8 sector, 0 = not 8 sector
  1932.      │ │ │ │ │ └───── 1 = removable, 0 = not removable
  1933.      └─┴─┴─┴─┴────── must be set to 1
  1934.  
  1935.     F8    Hard disk
  1936.         Double sided  18 sector diskette  PS/2 1.44 Mb. DSQD
  1937.  
  1938.     F9    5¼  Double sided, High Density diskette (15 sector)
  1939.         3½  Double Sided, Double High Density diskette (9 sector)
  1940.  
  1941.     FA    Ram disk (not all Ramdisks use this)
  1942.  
  1943.     FC    5¼ Single Sided, Double Density diskette (9 sector)
  1944.         8  inch Double Sided, Single Density diskette
  1945.  
  1946.     FD    5¼ Double Sided, Double Density (9 sector)
  1947.         8  inch Double Sided Single Density (26 sector) (IBM 3740
  1948.            format) 128 bytes per sector, soft sector, 4 sectors
  1949.            cluster, 4 reserved sectors, 2 FATs, 68 directory entries,
  1950.            77*26*2 sectors.
  1951.  
  1952.     FE    5¼ Single Sided, Double Density diskette (8 sector)
  1953.         8  inch Single Sided, Single Density diskette (26 sector)
  1954.            (IBM 3740 format) 128 bytes per sector, soft sector,
  1955.            4 sectors per cluster, 1 reserved sector, 2 FATs. 68
  1956.            directory entries, 77*26 sectors.
  1957.         8  inch Double Sided, Double Density (8 sector), 1024 bytes
  1958.            per sector, soft sector, 1 sector per cluster, 1 reserved
  1959.            sector, 2 FATs, 192 directory entries, 77*8*2 sectors. To
  1960.            distinguish from 8 inch SS/SD attempt read of side 2.
  1961.  
  1962.     FF    5¼ Double Sided, Double Density diskette (8 sector)
  1963.  
  1964.     - see also   ~INT 21,1B~  ~INT 21,1C~  ~FAT~
  1965. :Memory Control Block:MCB
  1966. ^MCB - DOS Memory Control Block Format
  1967.  
  1968. %     Offset Size        Description
  1969.  
  1970.     00   byte    'M' 4Dh  member of a MCB chain, (not last)
  1971.             'Z' 5Ah  indicates last entry in MCB chain
  1972.             other values cause "Memory Allocation Failure" on exit
  1973.     01   word    ~PSP~ segment address of MCB owner (Process Id)
  1974.             possible values:
  1975.                 0 = free
  1976.                 8 = Allocated by DOS before first user pgm loaded
  1977.                 other = Process Id/PSP segment address of owner
  1978.     03   word    number of paras related to this MCB (excluding MCB)
  1979.     05 11bytes    reserved
  1980.     08  8bytes    ASCII program name, NULL terminated if less than max
  1981.             length (DOS 4.x+)
  1982.     10  nbytes    first byte of actual allocated memory block
  1983.  
  1984.  
  1985.     - to find the first MCB in the chain, use  ~INT 21,52~
  1986.     - DOS 3.1+ the first memory block contains the DOS data segment
  1987.       ie., installable drivers, buffers, etc
  1988.     - DOS 4.x the first memory block is divided into subsegments,
  1989.       with their own memory control blocks; offset 0000h is the first
  1990.     - the 'M' and 'Z' are said to represent Mark Zbikowski
  1991.     - the MCB chain is often referred to as a linked list, but
  1992.       technically isn't
  1993.  
  1994.  
  1995. ^DOS 4.x Initial Data Segment Subsegment Control Blocks:
  1996.  
  1997. %     Offset Size      Description
  1998.     00   byte    subsegment type
  1999.             'D'  device driver
  2000.             'E'  device driver appendage
  2001.             'I'  Installable File System driver
  2002.             'F'  FILES= control block storage area (for FILES>5)
  2003.             'X'  FCBS= control block storage area, if present
  2004.             'C'  BUFFERS EMS workspace area if BUFFERS /X is used
  2005.             'B'  BUFFERS= storage area
  2006.             'L'  LASTDRIVE= current directory structure array
  2007.             'S'  STACKS= code/data area, if present (see below)
  2008.     01   word    paragraph of subsegment start
  2009.     03   word    subsegment size in paragraphs
  2010.     05  3bytes    unused
  2011.     08        types "D" and "I", filename of driver loaded driver
  2012.  
  2013.  
  2014.     - see  ~INT 21,48~  ~INT 21,49~  ~INT 21,4A~
  2015.  
  2016. :Program Segment Prefix:PSP
  2017. ^PSP - DOS Program Segment Prefix Layout
  2018.  
  2019. %     Offset Size          Description
  2020.  
  2021.     00   word    machine code ~INT 20~ instruction (CDh 20h)
  2022.     02   word    top of memory in segment (paragraph) form
  2023.     04   byte    reserved for DOS, usually 0
  2024.     05  5bytes    machine code instruction long call to the DOS
  2025.             function dispatcher (obsolete CP/M)
  2026.     06   word    .COM programs bytes available in segment (CP/M)
  2027.     0A   dword    ~INT 22~ terminate address;  DOS loader jumps to this
  2028.             address upon exit;  the EXEC function forces a child
  2029.             process to return to the parent by setting this
  2030.             vector to code within the parent (IP,CS)
  2031.     0E   dword    ~INT 23~ Ctrl-Break exit address; the original INT 23
  2032.             vector is NOT restored from this pointer (IP,CS)
  2033.     12   dword    ~INT 24~ critical error exit address; the original
  2034.             INT 24 vector is NOT restored from this field (IP,CS)
  2035.     16   word    parent process segment addr (Undoc. DOS 2.x+)
  2036.             COMMAND.COM has a parent id of zero, or its own PSP
  2037.     18  20bytes    file handle array (Undocumented DOS 2.x+); if handle
  2038.             array element is FF then handle is available.  Network
  2039.             redirectors often indicate remotes files by setting
  2040.             these to values between 80-FE.
  2041.     2C   word    segment address of the environment, or zero (DOS 2.x+)
  2042.     2E   dword    SS:SP on entry to last INT 21 function (Undoc. 2.x+) ╪
  2043.     32   word    handle array size (Undocumented DOS 3.x+)
  2044.     34   dword    handle array pointer (Undocumented DOS 3.x+)
  2045.     38   dword    pointer to previous PSP (deflt FFFF:FFFF, Undoc 3.x+) ╪
  2046.     3C  20bytes    unused in DOS before 4.01  ╪
  2047.     50   3bytes    DOS function dispatcher CDh 21h CBh (Undoc. 3.x+) ╪
  2048.     53   9bytes    unused
  2049.     5C  36bytes    default unopened ~FCB~ #1 (parts overlayed by FCB #2)
  2050.     6C  20bytes    default unopened FCB #2 (overlays part of FCB #1)
  2051.     80   byte    count of characters in command tail;  all bytes
  2052.             following command name;  also default ~DTA~ (128 bytes)
  2053.     81 127bytes    all characters entered after the program name followed
  2054.             by a CR byte
  2055.  
  2056.  
  2057.  
  2058.     - offset 5 contains a jump address which is 2 bytes too low for
  2059.       PSP's created by the DOS EXEC function in DOS 2.x+  ╪
  2060.     - program name and complete path can be found after the environment
  2061.       in DOS versions after 3.0.  See offset 2Ch.
  2062.  
  2063.     ╪ see ~Bibliography~ for reference to "Undocumented DOS"
  2064. :scan codes
  2065. ^INT 16 - Keyboard Scan Codes
  2066.  
  2067. %           Key     Normal    Shifted   w/Ctrl    w/Alt
  2068.  
  2069.         A      1E61        1E41      1E01    1E00
  2070.         B      3062        3042      3002    3000
  2071.         C      2E63        2E42      2E03    2E00
  2072.         D      2064        2044      2004    2000
  2073.         E      1265        1245      1205    1200
  2074.         F      2166        2146      2106    2100
  2075.         G      2267        2247      2207    2200
  2076.         H      2368        2348      2308    2300
  2077.         I      1769        1749      1709    1700
  2078.         J      246A        244A      240A    2400
  2079.         K      256B        254B      250B    2500
  2080.         L      266C        264C      260C    2600
  2081.         M      326D        324D      320D    3200
  2082.         N      316E        314E      310E    3100
  2083.         O      186F        184F      180F    1800
  2084.         P      1970        1950      1910    1900
  2085.         Q      1071        1051      1011    1000
  2086.         R      1372        1352      1312    1300
  2087.         S      1F73        1F53      1F13    1F00
  2088.         T      1474        1454      1414    1400
  2089.         U      1675        1655      1615    1600
  2090.         V      2F76        2F56      2F16    2F00
  2091.         W      1177        1157      1117    1100
  2092.         X      2D78        2D58      2D18    2D00
  2093.         Y      1579        1559      1519    1500
  2094.         Z      2C7A        2C5A      2C1A    2C00
  2095.     
  2096. %           Key     Normal    Shifted   w/Ctrl    w/Alt
  2097.  
  2098.         1      0231        0221        7800
  2099.         2      0332        0340      0300    7900
  2100.         3      0433        0423        7A00
  2101.         4      0534        0524        7B00
  2102.         5      0635        0625        7C00
  2103.         6      0736        075E      071E    7D00
  2104.         7      0837        0826        7E00
  2105.         8      0938        092A        7F00
  2106.         9      0A39        0A28        8000
  2107.         0      0B30        0B29        8100
  2108.  
  2109. %           Key     Normal    Shifted   w/Ctrl    w/Alt
  2110.  
  2111.         -      0C2D        0C5F      0C1F    8200
  2112.         =      0D3D        0D2B        8300
  2113.         [      1A5B        1A7B      1A1B    1A00
  2114.         ]      1B5D        1B7D      1B1D    1B00
  2115.         ;      273B        273A        2700
  2116.         '      2827        2822
  2117.         `      2960        297E
  2118.         \      2B5C        2B7C      2B1C    2600 (same as Alt L)
  2119.         ,      332C        333C
  2120.         .      342E        343E
  2121.         /      352F        353F
  2122.  
  2123. %        Key     Normal    Shifted   w/Ctrl    w/Alt
  2124.  
  2125.         F1      3B00        5400      5E00    6800
  2126.         F2      3C00        5500      5F00    6900
  2127.         F3      3D00        5600      6000    6A00
  2128.         F4      3E00        5700      6100    6B00
  2129.         F5      3F00        5800      6200    6C00
  2130.         F6      4000        5900      6300    6D00
  2131.         F7      4100        5A00      6400    6E00
  2132.         F8      4200        5B00      6500    6F00
  2133.         F9      4300        5C00      6600    7000
  2134.         F10      4400        5D00      6700    7100
  2135.         F11      8500        8700      8900    8B00
  2136.         F12      8600        8800      8A00    8C00
  2137.  
  2138. %        Key        Normal    Shifted    w/Ctrl      w/Alt
  2139.  
  2140.         BackSpace    0E08      0E08     0E7F      0E00
  2141.         Del         5300      532E     9300      A300
  2142.         Down Arrow   5000      5032     9100      A000
  2143.         End         4F00      4F31     7500      9F00
  2144.         Enter         1C0D      1C0D     1C0A      A600
  2145.         Esc         011B      011B     011B      0100
  2146.         Home         4700      4737     7700      9700
  2147.         Ins         5200      5230     9200      A200
  2148.         Keypad 5        4C35     8F00
  2149.         Keypad *     372A         9600      3700
  2150.         Keypad -     4A2D      4A2D     8E00      4A00
  2151.         Keypad +     4E2B      4E2B          4E00
  2152.         Keypad /     352F      352F     9500      A400
  2153.         Left Arrow   4B00      4B34     7300      9B00
  2154.         PgDn         5100      5133     7600      A100
  2155.         PgUp         4900      4939     8400      9900
  2156.         PrtSc                 7200
  2157.         Right Arrow  4D00      4D36     7400      9D00
  2158.         SpaceBar     3920      3920     3920      3920
  2159.         Tab         0F09      0F00     9400      A500
  2160.         Up Arrow     4800      4838     8D00      9800
  2161.  
  2162.  
  2163.     - Some key combinations are not available on all systems.  The PS/2
  2164.       includes many that aren't available on the PC, XT and AT.
  2165.     - To retrieve the character from a scan code logical AND the word
  2166.       with 0x00FF.
  2167.     - see  ~INT 16~  ~MAKE CODES~
  2168. :SFT:file table:System File Table
  2169. ^System File Table  (Undocumented)
  2170.  
  2171. ^DOS 2.x System File Table Format
  2172.  
  2173. %     Offset Size        Description
  2174.  
  2175.     00   dword    pointer to next system file table; offset of ffffh
  2176.             indicates last table in chain
  2177.     04   word    number of file descriptors in table
  2178.     06  nbytes    file descriptor table of the format (40 bytes each):
  2179.  
  2180. %     Offset Size        Description
  2181.  
  2182.     00   byte    count of handles referring to this file or
  2183.             zero if file is no longer open
  2184.     01   byte    open mode
  2185.     02   byte    file attribute
  2186.     03   byte    drive (1=A, 2=B:, ..., 0=char device)
  2187.     04 11bytes    filename in ~FCB~ format
  2188.     0F   word    unknown
  2189.     11   word    unknown
  2190.     13   dword    file size
  2191.     17   word    file date
  2192.     19   word    file time
  2193.     1B   byte    device attribute
  2194.     1C   word    starting cluster of file (block device)
  2195.          dword    pointer to device driver (if char device)
  2196.     1E   word    if block device, relative cluster within file of
  2197.             the last cluster read; zero if file has never
  2198.             been read or written
  2199.     20   word    absolute cluster number of current cluster
  2200.     22   word    unknown
  2201.     24   dword    current file position
  2202.  
  2203.  
  2204. ^DOS 3.x System File Table and FCB Table Format
  2205.  
  2206. %     Offset Size        Description
  2207.  
  2208.     00   dword    pointer to next system file table; offset of ffffh
  2209.             indicates last table in chain
  2210.     04   word    number of file descriptors in table
  2211.     06  nbytes    file descriptor table of the format (53 bytes each):
  2212.  
  2213. %     Offset Size        Description
  2214.  
  2215.     00   word      count of handles referring to this file or
  2216.             zero if file is no longer open
  2217.     02   word    open mode, bit 15 set if file id opened via FCB
  2218.     04   byte    file attribute
  2219.     05   word    device info word
  2220.     07   dword    if char device pointer to device driver header
  2221.             if block device pointer to DOS Device Control Block
  2222.     0B   word    starting cluster of file
  2223.     0D   word    file time
  2224.     0F   word    file date
  2225.     11   dword    file size
  2226.     15   dword    current file position
  2227.     19   word    if block device, relative cluster within file of
  2228.             the last cluster read
  2229.     1B   word    absolute cluster number of last cluster read
  2230.             zero if file has never been read or written
  2231.     1D   word    sector number containing the directory entry
  2232.     1F   byte    number of dir entry within sector
  2233.     20 11bytes    filename in ~FCB~ format
  2234.     2B   dword    SHARE pointer to previous ~SFT~ sharing same file
  2235.     2F   word    SHARE number of network machine opening file
  2236.     31   word    PSP segment of file owner
  2237.     33   word    offset within SHARE code segment of sharing record
  2238.             0000h = none
  2239.  
  2240.  
  2241. ^DOS 4.0+ System File Table and FCB Table
  2242.  
  2243. %     Offset Size        Description
  2244.  
  2245.     00   dword    pointer to next system file table; offset of ffffh
  2246.             indicates last table in chain
  2247.     04   word    number of file descriptors in table
  2248.     06  nbytes    file descriptor table of the format (59 bytes each):
  2249.  
  2250. %     Offset Size        Description
  2251.  
  2252.     00   word       count of handles referring to this file or
  2253.             zero if file is no longer open
  2254.     02   word    open mode, bit 15 set if file id opened via FCB
  2255.     04   byte    file attribute
  2256.     05   word    device info word
  2257.     07   dword    if char device pointer to device driver header
  2258.             if block device pointer to DOS Device Control Block
  2259.             or REDIR data
  2260.     0B   word    starting cluster of file
  2261.     0D   word    file time
  2262.     0F   word    file date
  2263.     11   dword    file size
  2264.     15   dword    current file position
  2265.     19   dword    if network redirector, pointer to REDIRIFS record
  2266.          word    if local block dev, relative cluster within file
  2267.             of the last cluster read
  2268.     1B   dword    if local, sector number of directory entry
  2269.     1F   byte    if local, number of directory entry within sector
  2270.     20  11bytes    filename in ~FCB~ format
  2271.     2B   dword    SHARE pointer to previous ~SFT~ sharing same file
  2272.     2F   word    SHARE number of network machine opening file
  2273.     31   word    PSP segment of file owner
  2274.     33   word    offset within SHARE code seg of sharing record
  2275.             0000h = none
  2276.     35   word    absolute cluster number of last cluster read
  2277.             zero if file has never been read or written
  2278.     37   dword    pointer to file IFS driver, NULL if native DOS
  2279.  
  2280.  
  2281.     - these structures are allocated by DOS during the scanning of the
  2282.       CONFIG.SYS file
  2283.     - ~INT 21,67~ can be used to allow an application to have more than
  2284.       20 file handles;  the total number of handles is limited still to
  2285.       the value of FILES=n in CONFIG.SYS
  2286.     - the structure of these fields is undocumented;  I do not recommend
  2287.       relying on any of this information, instead use it as an aid in
  2288.       debugging
  2289.     - see ~Bibliography~ references to Bernd Schemmer and "Data Structures
  2290.       Used in IBM PC Compatibles and the PS/2".
  2291.     - see    ~INT 21,52~
  2292.  
  2293. :system descriptor
  2294. ^BIOS System Descriptor Table  (PS/2)
  2295.  
  2296. %     Offset Size         Description
  2297.  
  2298.     00   word    length of descriptor (8 minimum)
  2299.     02   byte    model byte (same as FFFF:E, not reliable)
  2300.     03   byte    secondary model byte
  2301.     04   byte    BIOS revision level (zero based)
  2302.     05   byte    feature information  (see table)
  2303.     06  dword    reserved
  2304.  
  2305.  
  2306.     │7│6│5│4│3│2│1│0│ feature information at offset 5
  2307.      │ │ │ │ │ │ │ └─── reserved
  2308.      │ │ │ │ │ │ └──── 0=PC bus, 1=Micro Channel
  2309.      │ │ │ │ │ └───── Extended BIOS Data Area (~EBDA~) allocated
  2310.      │ │ │ │ └────── wait for external event supported
  2311.      │ │ │ └─────── ~INT 15,4F~ used (kbd intercept)
  2312.      │ │ └──────── RTC present
  2313.      │ └───────── 2nd ~8259~ present
  2314.      └────────── DMA channel 3 used by fixed disk BIOS
  2315.  
  2316.  
  2317.     - see also  ~MACHINE IDENT~  and  ~INT 15,C0~
  2318.  
  2319. :video information:video tables
  2320. ^Video Information Tables
  2321.  
  2322. %    BIOS Data Area Fields
  2323.  
  2324. %      Address    Size        Description
  2325.  
  2326.     40:49    byte    Current video mode  (see ~VIDEO MODE~)
  2327.     40:4A    word    Number of screen columns
  2328.     40:4C    word    Size of video regen buffer in bytes
  2329.     40:4E    word    Starting address in video regen buffer (offset)
  2330.     40:50  8 words    Cursor position of pages 1-8, high order
  2331.             byte=row, low order byte=column
  2332.     40:60    byte    Ending (bottom) scan line for cursor
  2333.     40:61    byte    Starting (top) scan line for cursor
  2334.     40:62    byte    Active display page number
  2335.     40:63    word    Base port address for active ~6845~ CRT controller
  2336.             3B4h = mono, 3D4h = color
  2337.     40:65    byte    6845 CRT mode control register value (port 3x8h)
  2338.             EGA/VGA values emulate those of the MDA/CGA
  2339.     40:66    byte    CGA current color palette setting (port 3d9h)
  2340.             EGA and VGA values emulate the CGA
  2341.     40:84    byte    Rows on the screen (less 1, EGA+)
  2342.     40:85    word    Point height of character matrix (EGA+)
  2343.     40:87    byte    Video mode options (EGA+)
  2344.  
  2345.         │7│6│5│4│3│2│1│0│ Video mode options (EGA+)
  2346.          │ │ │ │ │ │ │ └── 1=alphanumeric cursor emulation enabled
  2347.          │ │ │ │ │ │ └─── 1=video subsystem attached to monochrome
  2348.          │ │ │ │ │ └──── reserved
  2349.          │ │ │ │ └───── 1=video subsystem is inactive
  2350.          │ │ │ └────── reserved
  2351.          │ └─┴─────── video RAM  00-64K  10-192K  01-128K  11-256K
  2352.          └────────── video mode number passed to ~INT 10~, function 0
  2353.  
  2354.     40:88    byte    EGA feature bit switches, emulated on VGA
  2355.  
  2356.         │7│6│5│4│3│2│1│0│ EGA feature bit switches (EGA+)
  2357.          │ │ │ │ │ │ │ └── EGA SW1 config (1=off)
  2358.          │ │ │ │ │ │ └─── EGA SW2 config (1=off)
  2359.          │ │ │ │ │ └──── EGA SW3 config (1=off)
  2360.          │ │ │ │ └───── EGA SW4 config (1=off)
  2361.          │ │ │ └────── Input FEAT0 (ISR0 bit 5) after output on FCR0
  2362.          │ │ └─────── Input FEAT0 (ISR0 bit 6) after output on FCR0
  2363.          │ └──────── Input FEAT1 (ISR0 bit 5) after output on FCR1
  2364.          └───────── Input FEAT1 (ISR0 bit 6) after output on FCR1
  2365.  
  2366.     40:89    byte    Video display data area (MCGA and VGA)
  2367.  
  2368.         │7│6│5│4│3│2│1│0│ Video display data area (MCGA and VGA)
  2369.          │ │ │ │ │ │ │ └── 1=VGA is active
  2370.          │ │ │ │ │ │ └─── 1=gray scale is enabled
  2371.          │ │ │ │ │ └──── 1=using monochrome monitor
  2372.          │ │ │ │ └───── 1=default palette loading is disabled
  2373.          │ │ │ └────── see table below
  2374.          │ │ └─────── reserved
  2375.          │ └────────  1=display switching enabled
  2376.          └───────── alphanumeric scan lines (see table below)
  2377.  
  2378. %        Bit7   Bit4    Scan Line information
  2379.          0    0    350 line mode
  2380.          0    1    400 line mode
  2381.          1    0    200 line mode
  2382.          1    1    reserved
  2383.  
  2384.     40:8A    byte    Display Combination Code (DCC) table index (EGA+)
  2385.     40:A8  dword    BIOS Video Save/Override Pointer Table address
  2386.  
  2387.  
  2388. ^EGA / VGA Related Tables
  2389.  
  2390. %    Video Save/Override Pointer Table (pointer at 40:A8):
  2391.  
  2392.     00  dword  Video Parameter Table pointer
  2393.     04  dword  Dynamic Parameter Save Area pointer (EGA, VGA)
  2394.     08  dword  Alphanumeric Character Set Override pointer
  2395.     0C  dword  Graphics Character Set Override pointer
  2396.     10  dword  Secondary Save Pointer Table pointer (VGA)
  2397.     14  dword  reserved, set to 0000:0000
  2398.     18  dword  reserved, set to 0000:0000
  2399.  
  2400.  
  2401. %    Video Parameter Table
  2402.  
  2403.     00   byte    number of displayed character columns
  2404.     01   byte    number of displayed screen rows minus 1
  2405.     02   byte    character matrix height in points
  2406.     03   word    video buffer size in bytes
  2407.     05   dword   contents of sequencer registers 1-4
  2408.     09   byte    misc. output register values
  2409.     0A  25bytes  contents of CRTC registers 0-18h
  2410.     23  20bytes  contents of attribute controller regs 0-13h
  2411.     37  9 bytes  contents of graphics controller regs 0-8
  2412.  
  2413.  
  2414. %    Dynamic Parameter Save Area
  2415.  
  2416.     00  16bytes   contents of graphics controller pallette regs
  2417.     10    byte    contents of graphics controller overscan reg
  2418.     11  239bytes  reserved
  2419.  
  2420.  
  2421. %    Alphanumeric Character Set Override
  2422.  
  2423.     00   byte    length of each character definition in bytes
  2424.     01   byte    character generator RAM bank
  2425.     02   word    count of characters defined
  2426.     04   word    first character code in table
  2427.     06   dword   pointer to character font definition table
  2428.     0A   byte    number of character rows displayed
  2429.     0B   nbytes  array of applicable video modes
  2430.     0B+n byte    FFh end of mode list marker
  2431.  
  2432.  
  2433. %    Graphics Character Set Override
  2434.  
  2435.     00   byte    count of displayed character rows
  2436.     01   word    length of each character definition in bytes
  2437.     03   dword   pointer to character font definition table
  2438.     07   nbytes  array of applicable video modes
  2439.     07+n byte    FFh end of mode list marker
  2440.  
  2441.  
  2442. %    Secondary Save Pointer Table
  2443.  
  2444.     00  word   length of table in bytes
  2445.     02  dword  pointer to display combination code table
  2446.     06  dword  pointer to secondary alphanumeric char set override
  2447.     0A  dword  pointer to user palette profile table  (VGA)
  2448.     0E  dword  reserved
  2449.     12  dword  reserved
  2450.     16  dword  reserved
  2451.  
  2452.  
  2453. %    Display Combination Code Table
  2454.  
  2455.     00   byte   number of table entries
  2456.     01   byte   DCC table version number
  2457.     02   byte   maximum display type code
  2458.     03   byte   reserved
  2459.     04  n words array valid display combinations:
  2460.  
  2461.     0,0 entry  0  no display
  2462.     0,1 entry  1  MDPA
  2463.     0,2 entry  2  CGA
  2464.     2,1 entry  3  MDPA + CGA
  2465.     0,4 entry  4  EGA
  2466.     4,1 entry  5  EGA + MDPA
  2467.     0,5 entry  6  MEGA
  2468.     2,5 entry  7  MEGA + CGA
  2469.     0,6 entry  8  PGC
  2470.     1,6 entry  9  PGC + MDPA
  2471.     5,6 entry 10  PGC + MEGA
  2472.     0,8 entry 11  CVGA
  2473.     1,8 entry 12  CVGA + MDPA
  2474.     0,7 entry 13  MVGA
  2475.     2,7 entry 14  MVGA + CGA
  2476.     2,6 entry 15  MVGA + PGC
  2477.  
  2478.  
  2479. %    Secondary Alpha Mode Auxillary Character Generator Table
  2480.  
  2481.     00   byte    bytes per character
  2482.     01   byte    block to load
  2483.     02   byte    reserved
  2484.     03   dword   font table pointer
  2485.     07   nbytes  array of mode values for this font
  2486.     07+n byte    FFh end of mode list marker
  2487.  
  2488.  
  2489. %    Palette Profile Table (VGA only)
  2490.  
  2491.     00   byte    1 - enable underlining in all alphanumeric modes
  2492.              0 - enable underlining in monochrome alpha modes
  2493.             -1 - disable underlining in all alpha modes
  2494.     01   byte   reserved
  2495.     02   word   reserved
  2496.     04   word   count of attribute controller regs in table
  2497.     06   word   first attribute controller register number
  2498.     08   dword  pointer to attribute controller reg table
  2499.     0C   word   count of video DAC color registers in table
  2500.     0E   word   first video DAC color register number
  2501.     10   dword  video DAC color register table pointer
  2502.     14   nbytes array of applicable video modes for this font
  2503.     14+n byte   FFh end of video mode list marker
  2504.  
  2505.  
  2506.     - see also ~BIOS Data Area~
  2507.     - see ~INT 10,1B~ for Dynamic Video State Table and Video Static
  2508.       Functionality Table
  2509.  
  2510. :video pages
  2511. ^Video modes and corresponding number of pages
  2512.  
  2513.  
  2514. %          Mode      Pages        Adapters
  2515.  
  2516.         00     pages 0-7    (CGA,EGA,MCGA,VGA)
  2517.         01     pages 0-7    (CGA,EGA,MCGA,VGA)
  2518.         02     pages 0-3    (CGA)
  2519.             pages 0-7    (EGA,MCGA,VGA)
  2520.         03    pages 0-3    (CGA)
  2521.             pages 0-7    (EGA,MCGA,VGA)
  2522.         07    pages 0-7    (EGA,VGA)
  2523.             no pages    (MDA)
  2524.         0D    pages 0-7    (EGA,VGA)
  2525.         0E    pages 0-4    (EGA,VGA)
  2526.         0F    pages 0-1    (EGA,VGA)
  2527.         10    pages 0-1    (EGA,VGA)
  2528.  
  2529. :XFCB:Extended FCB:extended file ctlblk
  2530. ^XFCB - Extended DOS File Control Block
  2531.  
  2532. %     Offset Size        Description
  2533.  
  2534.     00   byte   flag containing FF if this is an extended ~FCB~
  2535.     01  5bytes  reserved
  2536.     06   byte   directory attribute byte    (see ~FILE ATTRIBUTE~)
  2537.     07   byte   drive number (0 for default drive, 1 = A:, 2 = B:)
  2538.     08  8bytes  filename, left justified with trailing blanks
  2539.     16  3bytes  filename extension, left justified w/blanks
  2540.     19   word   current block number relative to file start (0 based)
  2541.     21   word   logical record size in bytes
  2542.     23   dword  file size in bytes
  2543.     27   word   date the file was created or last updated:
  2544.  
  2545.         │F│E│D│C│B│A│9│8│7│6│5│4│3│2│1│0│ 21,20
  2546.          │ │ │ │ │ │ │ │ │ │ │ └─┴─┴─┴─┴─ day 1-31
  2547.          │ │ │ │ │ │ │ └─┴─┴─┴────────── month 1-12
  2548.          └─┴─┴─┴─┴─┴─┴───────────────── year + 1980
  2549.  
  2550.     29 16bytes  reserved for system use
  2551.     39   byte   relative record number within current BLOCK
  2552.     40  4bytes  relative record number from start of file (0 based)
  2553.  
  2554.