home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / UTILS / INTERRPT / INT2GUID / INT2GUID.TAB < prev    next >
Text File  |  1993-11-07  |  55KB  |  1,277 lines

  1. ;Text for INT2GUID conversion program, topic 21.
  2. ;INT2GUID converts INTERRUP.LST files to input for GUIDE.
  3. ;
  4. ;NB! When updating, remember to update the release number in the next
  5. ;paragraph, and in the beginning the text.
  6. ;
  7. ;This file contains tables extracted from the INTERRUP.LST file release 37.
  8. ;Tabs in the extracted text were filtered to 1 - 8 spaces.
  9. ;
  10. ;This file includes 4 extra topics. Reserve additionally 6 topics, or a
  11. ;total of 10.
  12. ;
  13. ;Topic headings are included in the GUIDE main index unless the configuration
  14. ;file specifies mask 0x8000.
  15. ;
  16. PSP Format, Environment Block, Country Specific Information, Error List
  17.  
  18. This entry gives access to tables extracted from the INTERRUP.LST file,
  19. release 37.
  20.  
  21.   22PSP + Env.   Program Segment Prefix Format + Environment
  22.   23Country      Specific Information
  23.   24Errors       Returned by DOS Funtion Calls
  24.   25EXE          *.EXE File Header etc.
  25. ;
  26. !TOPIC 22 PSP Format
  27. !! 0x8000
  28. !NOINDEX
  29. !! 0
  30. ;
  31. --------D-2126-------------------------------
  32. INT 21 - DOS 1+ - CREATE NEW PROGRAM SEGMENT PREFIX
  33.         AH = 26h
  34.         DX = segment at which to create PSP (see below)
  35. Notes:  new PSP is updated with memory size information; INTs 22h, 23h, 24h
  36.           taken from interrupt vector table; the parent PSP field is set to 0
  37.         (DOS 2+) DOS assumes that the caller's CS is the segment of the PSP to
  38.           copy
  39. SeeAlso: AH=4Bh,AH=50h,AH=51h,AH=55h,AH=62h,AH=67h
  40.  
  41. Format of PSP:
  42. Offset  Size    Description
  43.  00h  2 BYTEs   INT 20 instruction for CP/M CALL 0 program termination
  44.                 the CDh 20h here is often used as a signature for a valid PSP
  45.  02h    WORD    segment of first byte beyond memory allocated to program
  46.  04h    BYTE    unused filler
  47.  05h    BYTE    CP/M CALL 5 service request (FAR JMP to 000C0h)
  48.                 BUG: (DOS 2+) PSPs created by INT 21/AH=4Bh point at 000BEh
  49.  06h    WORD    CP/M compatibility--size of first segment for .COM files
  50.  08h  2 BYTEs   remainder of FAR JMP at 05h
  51.  0Ah    DWORD   stored INT 22 termination address
  52.  0Eh    DWORD   stored INT 23 control-Break handler address
  53.  12h    DWORD   DOS 1.1+ stored INT 24 critical error handler address
  54.  16h    WORD    segment of parent PSP
  55.  18h 20 BYTEs   DOS 2+ Job File Table, one byte per file handle, FFh = closed
  56.  2Ch    WORD    DOS 2+ segment of environment for process
  57.  2Eh    DWORD   DOS 2+ process's SS:SP on entry to last INT 21 call
  58.  32h    WORD    DOS 3+ number of entries in JFT (default 20)
  59.  34h    DWORD   DOS 3+ pointer to JFT (default PSP:0018h)
  60.  38h    DWORD   DOS 3+ pointer to previous PSP (default FFFFFFFFh in 3.x)
  61.                 used by SHARE in DOS 3.3
  62.  3Ch    BYTE    apparently unused by DOS versions <= 6.00
  63.  3Dh    BYTE    apparently used by some versions of APPEND
  64.  3Eh    BYTE    (Novell NetWare) flag: next byte initialized if CEh
  65.  3Fh    BYTE    (Novell Netware) Novell task number if previous byte is CEh
  66.  40h  2 BYTEs   DOS 5+ version to return on INT 21/AH=30h
  67.  42h    WORD    (MSWin3) selector of next PSP (PDB) in linked list
  68.                 Windows keeps a linked list of Windows programs only
  69.  44h  4 BYTEs   unused by DOS versions <= 6.00
  70.  48h    BYTE    (MSWindows3) bit 0 set if non-Windows application (WINOLDAP)
  71.  49h  7 BYTEs   unused by DOS versions <= 6.00
  72.  50h  3 BYTEs   DOS 2+ service request (INT 21/RETF instructions)
  73.  53h  2 BYTEs   unused in DOS versions <= 6.00
  74.  55h  7 BYTEs   unused in DOS versions <= 6.00; can be used to make first FCB
  75.                 into an extended FCB
  76.  5Ch 16 BYTEs   first default FCB, filled in from first commandline argument
  77.                 overwrites second FCB if opened
  78.  6Ch 16 BYTEs   second default FCB, filled in from second commandline argument
  79.                 overwrites beginning of commandline if opened
  80.  7Ch  4 BYTEs   unused
  81.  80h 128 BYTEs  commandline / default DTA
  82.                 command tail is BYTE for length of tail, N BYTEs for the tail,
  83.                 followed by a BYTE containing 0Dh
  84. Notes:  in DOS v3+, the limit on simultaneously open files may be increased by
  85.           allocating memory for a new open file table, filling it with FFh,
  86.           copying the first 20 bytes from the default table, and adjusting the
  87.           pointer and count at 34h and 32h.  However, DOS will only copy the
  88.           first 20 file handles into a child PSP (including the one created on
  89.           EXEC).
  90.         network redirectors based on the original MS-Net implementation use
  91.           values of 80h-FEh in the open file table to indicate remote files;
  92.           Novell NetWare reportedly also uses values of 80h-FEh
  93.         MS-DOS 5.00 incorrectly fills the FCB fields when loading a program
  94.           high; the first FCB is empty and the second contains the first
  95.           parameter
  96.         some DOS extenders place protected-mode values in various PSP fields
  97.           such as the "parent" field, which can confuse PSP walkers.  Always
  98.           check either for the CDh 20h signature or that the suspected PSP is
  99.           at the beginning of a memory block which owns itself (the preceding
  100.           paragraph should be a valid MCB with "owner" the same as the
  101.           suspected PSP).
  102.         Novell NetWare updates the fields at offsets 3Eh and 3Fh without
  103.           checking that a legal PSP segment is current; see AH=50h for further
  104.           discussion
  105.  
  106. Format of environment block:
  107. Offset  Size    Description
  108.  00h  N BYTEs   first environment variable, ASCIZ string of form "var=value"
  109.       N BYTEs   second environment variable, ASCIZ string
  110.         ...
  111.       N BYTEs   last environment variable, ASCIZ string of form "var=value"
  112.         BYTE    00h
  113. ---DOS 3+---
  114.         WORD    number of strings following environment (normally 1)
  115.       N BYTEs   ASCIZ full pathname of program owning this environment
  116.                 other strings may follow
  117. ;
  118. !TOPIC 23 Country Info
  119. !! 0x8000
  120. !NOINDEX
  121. !! 0
  122. ;
  123. --------D-2138-------------------------------
  124. INT 21 - DOS 2+ - GET COUNTRY-SPECIFIC INFORMATION
  125.         AH = 38h
  126. --DOS 2.x--
  127.         AL = 00h get current-country info
  128.         DS:DX -> buffer for returned info (see below)
  129. Return: CF set on error
  130.             AX = error code (02h)
  131.         CF clear if successful
  132.             AX = country code (MS-DOS 2.11 only)
  133.             buffer at DS:DX filled
  134. --DOS 3+--
  135.         AL = 00h for current country
  136.         AL = 01h thru 0FEh for specific country with code <255
  137.         AL = 0FFh for specific country with code >= 255
  138.            BX = 16-bit country code
  139.         DS:DX -> buffer for returned info (see below)
  140. Return: CF set on error
  141.             AX = error code (02h)
  142.         CF clear if successful
  143.             BX = country code
  144.             DS:DX buffer filled
  145. Note:   this function is not supported by the Borland DPMI host, but no error
  146.           is returned; as a workaround, one should allocate a buffer in
  147.           conventional memory with INT 31/AX=0100h and simulate an INT 21 with
  148.           INT 31/AX=0300h
  149. SeeAlso: AH=65h,INT 10/AX=5001h,INT 2F/AX=110Ch,INT 2F/AX=1404h
  150.  
  151. Format of PC-DOS 2.x country info:
  152. Offset  Size    Description
  153.  00h    WORD    date format  0 = USA    mm dd yy
  154.                              1 = Europe dd mm yy
  155.                              2 = Japan  yy mm dd
  156.  02h    BYTE    currency symbol
  157.  03h    BYTE    00h
  158.  04h    BYTE    thousands separator char
  159.  05h    BYTE    00h
  160.  06h    BYTE    decimal separator char
  161.  07h    BYTE    00h
  162.  08h 24 BYTEs   reserved
  163.  
  164. Format of MS-DOS 2.x,DOS 3+ country info:
  165. Offset  Size    Description
  166.  00h    WORD    date format (see above)
  167.  02h  5 BYTEs   ASCIZ currency symbol string
  168.  07h  2 BYTEs   ASCIZ thousands separator
  169.  09h  2 BYTEs   ASCIZ decimal separator
  170.  0Bh  2 BYTEs   ASCIZ date separator
  171.  0Dh  2 BYTEs   ASCIZ time separator
  172.  0Fh    BYTE    currency format
  173.                 bit 2 = set if currency symbol replaces decimal point
  174.                 bit 1 = number of spaces between value and currency symbol
  175.                 bit 0 = 0 if currency symbol precedes value
  176.                         1 if currency symbol follows value
  177.  10h    BYTE    number of digits after decimal in currency
  178.  11h    BYTE    time format
  179.                 bit 0 = 0 if 12-hour clock
  180.                         1 if 24-hour clock
  181.  12h    DWORD   address of case map routine
  182.                 (FAR CALL, AL = character to map to upper case [>= 80h])
  183.  16h  2 BYTEs   ASCIZ data-list separator
  184.  18h 10 BYTEs   reserved
  185.  
  186. Values for country code:
  187.    1 001h   United States
  188.    2 002h   Canadian-French
  189.    3 003h   Latin America
  190.   31 01Fh   Netherlands
  191.   32 020h   Belgium
  192.   33 021h   France
  193.   34 022h   Spain
  194.   36 024h   Hungary (not supported by DR-DOS 5.0)
  195.   38 026h   Yugoslavia (not supported by DR-DOS 5.0)
  196.   39 027h   Italy
  197.   41 029h   Switzerland
  198.   42 02Ah   Czechoslovakia/Tjekia (not supported by DR-DOS 5.0)
  199.   43 02Bh   Austria (DR-DOS 5.0)
  200.   44 02Ch   United Kingdom
  201.   45 02Dh   Denmark
  202.   46 02Eh   Sweden
  203.   47 02Fh   Norway
  204.   48 030h   Poland (not supported by DR-DOS 5.0)
  205.   49 031h   Germany
  206.   55 037h   Brazil (not supported by DR-DOS 5.0)
  207.   61 03Dh   International English [Australia in DR-DOS 5.0]
  208.   81 051h   Japan (DR-DOS 5.0, MS-DOS 5.0+)
  209.   82 052h   Korea (DR-DOS 5.0)
  210.   86 056h   China (MS-DOS 5.0+)
  211.   88 058h   Taiwan (MS-DOS 5.0+)
  212.   90 05Ah   Turkey (MS-DOS 5.0+)
  213.  351 15Fh   Portugal
  214.  354 162h   Iceland
  215.  358 166h   Finland
  216.  785 311h   Middle East/Saudi Arabia (DR-DOS 5.0,MS-DOS 5.0+)
  217.  972 3CCh   Israel (DR-DOS 5.0,MS-DOS 5.0+)
  218. --------D-2138--DXFFFF-----------------------
  219. INT 21 - DOS 3+ - SET COUNTRY CODE
  220.         AH = 38h
  221.         DX = FFFFh
  222.         AL = 01h thru FEh for specific country with code <255
  223.         AL = FFh for specific country with code >= 255
  224.            BX = 16-bit country code (see AH=38h)
  225. Return: CF set on error
  226.             AX = error code (see AH=59h)
  227.         CF clear if successful
  228. Note:   not supported by OS/2
  229. SeeAlso: INT 2F/AX=1403h
  230. --------D-2165-------------------------------
  231. INT 21 - DOS 3.3+ - GET EXTENDED COUNTRY INFORMATION
  232.         AH = 65h
  233.         AL = info ID
  234.             01h get general internationalization info
  235.             02h get pointer to uppercase table
  236.             04h get pointer to filename uppercase table
  237.             05h get pointer to filename terminator table
  238.             06h get pointer to collating sequence table
  239.             07h (DOS 4+) get pointer to Double-Byte Character Set table
  240.         BX = code page (FFFFh=global code page)
  241.         DX = country ID (FFFFh=current country)
  242.         ES:DI -> country information buffer (see below)
  243.         CX = size of buffer (>= 5)
  244. Return: CF set on error
  245.             AX = error code (see AH=59h)
  246.         CF clear if successful
  247.             CX = size of country information returned
  248.             ES:DI -> country information
  249. Notes:  AL=05h appears to return same info for all countries and codepages; it
  250.           has been documented for DOS 5+, but was undocumented in ealier
  251.           versions
  252.         NLSFUNC must be installed to get info for countries other than the
  253.           default
  254.         subfunctions 02h and 04h are identical under OS/2
  255. SeeAlso: AH=38h,INT 2F/AX=1401h,INT 2F/AX=1402h,INT 2F/AX=14FEh
  256.  
  257. Format of country information:
  258. Offset  Size    Description
  259.  00h    BYTE    info ID
  260. ---if info ID = 01h---
  261.  01h    WORD    size
  262.  03h    WORD    country ID
  263.  05h    WORD    code page
  264.  07h 34 BYTEs   country-dependent info (see AH=38h)
  265. ---if info ID = 02h---
  266.  01h    DWORD   pointer to uppercase table (see below)
  267. ---if info ID = 04h---
  268.  01h    DWORD   pointer to filename uppercase table (see below)
  269. ---if info ID = 05h---
  270.  01h    DWORD   pointer to filename character table (see below)
  271. ---if info ID = 06h---
  272.  01h    DWORD   pointer to collating table (see below)
  273. ---if info ID = 07h (DOS 4+)---
  274.  01h    DWORD   pointer to DBCS lead byte table (see below)
  275.  
  276. Format of uppercase table:
  277. Offset  Size    Description
  278.  00h    WORD    table size
  279.  02h 128 BYTEs  uppercase equivalents (if any) of chars 80h to FFh
  280.  
  281. Format of collating table:
  282. Offset  Size    Description
  283.  00h    WORD    table size
  284.  02h 256 BYTEs  values used to sort characters 00h to FFh
  285.  
  286. Format of filename terminator table:
  287. Offset  Size    Description
  288.  00h    WORD    table size (not counting this word)
  289.  02h    BYTE    ??? (01h for MS-DOS 3.30-6.00)
  290.  03h    BYTE    lowest permissible character value for filename
  291.  04h    BYTE    highest permissible character value for filename
  292.  05h    BYTE    ??? (00h for MS-DOS 3.30-6.00)
  293.  06h    BYTE    first excluded character in range \ all characters in this
  294.  07h    BYTE    last excluded character in range  / range are illegal
  295.  08h    BYTE    ??? (02h for MS-DOS 3.30-6.00)
  296.  09h    BYTE    number of illegal (terminator) characters
  297.  0Ah  N BYTEs   characters which terminate a filename:  ."/\[]:|<>+=;,
  298. Note:   partially documented for DOS 5+, but undocumented for earlier versions
  299.  
  300. Format of filename uppercase table:
  301. Offset  Size    Description
  302.  00h    WORD    table size
  303.  02h 128 BYTEs  uppercase equivalents (if any) of chars 80h to FFh
  304.  
  305. Format of DBCS lead byte table:
  306. Offset  Size    Description
  307.  00h    WORD    length
  308.  02h 2N BYTEs   start/end for N lead byte ranges
  309.         WORD    0000h   (end of table)
  310. --------D-2165-------------------------------
  311. INT 21 - DOS 4+ - COUNTRY-DEPENDENT CHARACTER CAPITALIZATION
  312.         AH = 65h
  313.         AL = function
  314.             20h capitalize character
  315.                 DL = character to capitalize
  316.                 Return: DL = capitalized character
  317.             21h capitalize string
  318.                 DS:DX -> string to capitalize
  319.                 CX = length of string
  320.             22h capitalize ASCIZ string
  321.                 DS:DX -> ASCIZ string to capitalize
  322. Return: CF set on error
  323.             AX = error code (see AH=59h)
  324.         CF clear if successful
  325. Note:   these calls have been documented for DOS 5+, but were undocumented in
  326.           DOS 4.x.
  327. --------D-216523-----------------------------
  328. INT 21 U - DOS 4+ internal - DETERMINE IF CHARACTER REPRESENTS YES/NO RESPONSE
  329.         AX = 6523h
  330.         DL = character
  331.         DH = second character of double-byte character (if applicable)
  332. Return: CF set on error
  333.         CF clear if successful
  334.             AX = type
  335.                 00h no
  336.                 01h yes
  337.                 02h neither yes nor no
  338. --------D-2165-------------------------------
  339. INT 21 U - DOS 4+ internal - COUNTRY-DEPENDENT FILENAME CAPITALIZATION
  340.         AH = 65h
  341.         AL = function
  342.             A0h capitalize filename character
  343.                 DL = character to capitalize
  344.                 Return: DL = capitalized character
  345.             A1h capitalize counted filename string
  346.                 DS:DX -> filename string to capitalize
  347.                 CX = length of string
  348.             A2h capitalize ASCIZ filename
  349.                 DS:DX -> ASCIZ filename to capitalize
  350. Return: CF set on error
  351.             AX = error code (see AH=59h)
  352.         CF clear if successful
  353. Note:   nonfunctional in DOS 4.00 through 6.00 due to a bug (the code sets a
  354.           pointer depending on the high bit of AL, but doesn't clear the
  355.           bit before branching by function number).
  356. --------D-216601-----------------------------
  357. INT 21 - DOS 3.3+ - GET GLOBAL CODE PAGE TABLE
  358.         AX = 6601h
  359. Return: CF set on error
  360.             AX = error code (see AH=59h)
  361.         CF clear if successful
  362.             BX = active code page (see AX=6602h)
  363.             DX = system code page
  364. SeeAlso: AX=6602h
  365. --------D-216602-----------------------------
  366. INT 21 - DOS 3.3+ - SET GLOBAL CODE PAGE TABLE
  367.         AX = 6602h
  368.         BX = active code page (see below)
  369.         DX = system code page (active page at boot time)
  370. Return: CF set on error
  371.             AX = error code (see AH=59h)
  372.         CF clear if successful
  373. SeeAlso: AX=6601h,INT 2F/AX=14FFh
  374.  
  375. Values for code page:
  376.  437    US
  377.  850    Multilingual
  378.  852    Slavic/Latin II (DOS 5+)
  379.  857    Turkish
  380.  860    Portugal
  381.  861    Iceland
  382.  863    Canada (French)
  383.  865    Norway/Denmark
  384. ;
  385. !TOPIC 24 Error Codes
  386. !! 0x8000
  387. !NOINDEX
  388. !! 0
  389. ;
  390. --------D-2159--BX0000-----------------------
  391. INT 21 - DOS 3+ - GET EXTENDED ERROR INFORMATION
  392.         AH = 59h
  393.         BX = 0000h
  394. Return: AX = extended error code (see below)
  395.         BH = error class (see below)
  396.         BL = recommended action (see below)
  397.         CH = error locus (see below)
  398.         ES:DI may be pointer (see error code list below)
  399.         CL, DX, SI, BP, and DS destroyed
  400. Notes:  functions available under DOS 2.x map the true DOS 3+ error code into
  401.           one supported under DOS 2.x
  402.         you should call this function to retrieve the true error code when an
  403.           FCB or DOS 2.x call returns an error
  404.         under DR-DOS 5.0, this function does not use any of the DOS-internal
  405.           stacks and may thus be called at any time
  406. SeeAlso: AH=59h/BX=0001h,AX=5D0Ah,INT 2F/AX=122Dh
  407.  
  408. Values for extended error code:
  409.  00h (0)   no error
  410.  01h (1)   function number invalid
  411.  02h (2)   file not found
  412.  03h (3)   path not found
  413.  04h (4)   too many open files (no handles available)
  414.  05h (5)   access denied
  415.  06h (6)   invalid handle
  416.  07h (7)   memory control block destroyed
  417.  08h (8)   insufficient memory
  418.  09h (9)   memory block address invalid
  419.  0Ah (10)  environment invalid (usually >32K in length)
  420.  0Bh (11)  format invalid
  421.  0Ch (12)  access code invalid
  422.  0Dh (13)  data invalid
  423.  0Eh (14)  reserved
  424.  0Fh (15)  invalid drive
  425.  10h (16)  attempted to remove current directory
  426.  11h (17)  not same device
  427.  12h (18)  no more files
  428. ---DOS 3+---
  429.  13h (19)  disk write-protected
  430.  14h (20)  unknown unit
  431.  15h (21)  drive not ready
  432.  16h (22)  unknown command
  433.  17h (23)  data error (CRC)
  434.  18h (24)  bad request structure length
  435.  19h (25)  seek error
  436.  1Ah (26)  unknown media type (non-DOS disk)
  437.  1Bh (27)  sector not found
  438.  1Ch (28)  printer out of paper
  439.  1Dh (29)  write fault
  440.  1Eh (30)  read fault
  441.  1Fh (31)  general failure
  442.  20h (32)  sharing violation
  443.  21h (33)  lock violation
  444.  22h (34)  disk change invalid
  445.         ES:DI -> ASCIZ volume label of required disk
  446.  23h (35)  FCB unavailable
  447.  24h (36)  sharing buffer overflow
  448.  25h (37)  (DOS 4+) code page mismatch
  449.  26h (38)  (DOS 4+) cannot complete file operation (out of input)
  450.  27h (39)  (DOS 4+) insufficient disk space
  451.  28h-31h   reserved
  452.  32h (50)  network request not supported
  453.  33h (51)  remote computer not listening
  454.  34h (52)  duplicate name on network
  455.  35h (53)  network name not found
  456.  36h (54)  network busy
  457.  37h (55)  network device no longer exists
  458.  38h (56)  network BIOS command limit exceeded
  459.  39h (57)  network adapter hardware error
  460.  3Ah (58)  incorrect response from network
  461.  3Bh (59)  unexpected network error
  462.  3Ch (60)  incompatible remote adapter
  463.  3Dh (61)  print queue full
  464.  3Eh (62)  queue not full
  465.  3Fh (63)  not enough space to print file
  466.  40h (64)  network name was deleted
  467.  41h (65)  network: Access denied
  468.  42h (66)  network device type incorrect
  469.  43h (67)  network name not found
  470.  44h (68)  network name limit exceeded
  471.  45h (69)  network BIOS session limit exceeded
  472.  46h (70)  temporarily paused
  473.  47h (71)  network request not accepted
  474.  48h (72)  network print/disk redirection paused
  475.  49h (73)  network software not installed
  476.            (LANtastic) invalid network version
  477.  4Ah (74)  unexpected adapter close
  478.            (LANtastic) account expired
  479.  4Bh (75)  (LANtastic) password expired
  480.  4Ch (76)  (LANtastic) login attempt invalid at this time
  481.  4Dh (77)  (LANtastic v3+) disk limit exceeded on network node
  482.  4Eh (78)  (LANtastic v3+) not logged in to network node
  483.  4Fh (79)  reserved
  484.  50h (80)  file exists
  485.  51h (81)  reserved
  486.  52h (82)  cannot make directory
  487.  53h (83)  fail on INT 24h
  488.  54h (84)  (DOS 3.3+) too many redirections
  489.  55h (85)  (DOS 3.3+) duplicate redirection
  490.  56h (86)  (DOS 3.3+) invalid password
  491.  57h (87)  (DOS 3.3+) invalid parameter
  492.  58h (88)  (DOS 3.3+) network write fault
  493.  59h (89)  (DOS 4+) function not supported on network
  494.  5Ah (90)  (DOS 4+) required system component not installed
  495.  64h (100) (MSCDEX) unknown error
  496.  65h (101) (MSCDEX) not ready
  497.  66h (102) (MSCDEX) EMS memory no longer valid
  498.  67h (103) (MSCDEX) not High Sierra or ISO-9660 format
  499.  68h (104) (MSCDEX) door open
  500.  
  501. Values for Error Class:
  502.    1 01h    out of resource (storage space or I/O channels)
  503.    2 02h    temporary situation (file or record lock)
  504.    3 03h    authorization (denied access)
  505.    4 04h    internal (system software bug)
  506.    5 05h    hardware failure
  507.    6 06h    system failure (configuration file missing or incorrect)
  508.    7 07h    application program error
  509.    8 08h    not found
  510.    9 09h    bad format
  511.   10 0Ah    locked
  512.   11 0Bh    media error
  513.   12 0Ch    already exists
  514.   13 0Dh    unknown
  515.  
  516. Values for Suggested Action:
  517.    1 01h    retry
  518.    2 02h    delayed retry
  519.    3 03h    prompt user to reenter input
  520.    4 04h    abort after cleanup
  521.    5 05h    immediate abort
  522.    6 06h    ignore
  523.    7 07h    retry after user intervention
  524.  
  525. Values for Error Locus:
  526.    1 01h    unknown or not appropriate
  527.    2 02h    block device (disk error)
  528.    3 03h    network related
  529.    4 04h    serial device (timeout)
  530.    5 05h    memory related
  531. ;
  532. !TOPIC 25 EXE Header etc
  533. !! 0x8000
  534. !NOINDEX
  535. !! 0
  536. ;
  537. --------D-214B-------------------------------
  538. INT 21 - DOS 2+ - "EXEC" - LOAD AND/OR EXECUTE PROGRAM
  539.         AH = 4Bh
  540.         AL = type of load
  541.             00h load and execute
  542.             01h load but do not execute
  543.             03h load overlay
  544.             04h load and execute in background (European MS-DOS 4.0 only)
  545.                 "Exec & Go" (see also AH=80h)
  546.         DS:DX -> ASCIZ program name (must include extension)
  547.         ES:BX -> parameter block (see below)
  548.         CX = mode (subfunction 04h only)
  549.                 0000h child placed in zombie mode after termination
  550.                 0001h child's return code discarded on termination
  551. Return: CF clear if successful
  552.             BX,DX destroyed
  553.             if subfunction 01h, process ID set to new program's PSP; get with
  554.                 INT 21/AH=62h
  555.         CF set on error
  556.             AX = error code (01h,02h,05h,08h,0Ah,0Bh) (see AH=59h)
  557. Notes:  DOS 2.x destroys all registers, including SS:SP
  558.         under ROM-based DOS, if no disk path characters (colons or slashes)
  559.           are included in the program name, the name is searched for in the
  560.           ROM module headers (see below) before searching on disk
  561.         for functions 00h and 01h, the calling process must ensure that there
  562.           is enough unallocated memory available; if necessary, by releasing
  563.           memory with AH=49h or AH=4Ah
  564.         for function 01h, the AX value to be passed to the child program is put
  565.           on top of the child's stack
  566.         for function 03h, DOS assumes that the overlay is being loaded into
  567.           memory allocated by the caller
  568.         function 01h was undocumented prior to the release of DOS 5.0
  569.         some versions (such as DR-DOS 6.0) check the parameters and parameter
  570.           block and return an error if an invalid value (such as an offset of
  571.           FFFFh) is found
  572.         background programs under European MS-DOS 4.0 must use the new
  573.           executable format
  574.         new executables begin running with the following register values
  575.                 AX = environment segment
  576.                 BX = offset of command tail in environment segment
  577.                 CX = size of automatic data segment (0000h = 64K)
  578.                 ES,BP = 0000h
  579.                 DS = automatic data segment
  580.                 SS:SP = initial stack
  581.           the command tail corresponds to an old executable's PSP:0081h and
  582.           following, except that the 0Dh is turned into a NUL (00h); new
  583.           format executables have no PSP
  584.         under the FlashTek X-32 DOS extender, only function 00h is supported
  585.           and the pointers are passed in DS:EDX and ES:EBX
  586.         DR-DOS 6 always loads .EXE-format programs with no fixups above the
  587.           64K mark to avoid the EXEPACK bug
  588.         names for the various executable type understood by various
  589.           environments:
  590.                 MZ  old-style DOS executable
  591.                 NE  Windows or OS/2 1.x segmented ("new") executable
  592.                 LE  Windows virtual device driver (VxD) linear executable
  593.                 LX  variant of LE used in OS/2 2.x
  594.                 W3  Windows WIN386.EXE file; a collection of LE files
  595.                 PE  Win32 (Windows NT and Win32s) portable executable based on
  596.                         Unix COFF
  597. BUGS:   DOS 2.00 assumes that DS points at the current program's PSP
  598.         Load Overlay (subfunction 03h) loads up to 512 bytes too many if the
  599.           file contains additional data after the actual overlay
  600. SeeAlso: AX=4B05h,AH=4Ch,AH=4Dh,AH=64h"OS/2",AH=8Ah,INT 2E
  601.  
  602. Format of EXEC parameter block for AL=00h,01h,04h:
  603. Offset  Size    Description
  604.  00h    WORD    segment of environment to copy for child process (copy caller's
  605.                 environment if 0000h)
  606.  02h    DWORD   pointer to command tail to be copied into child's PSP
  607.  06h    DWORD   pointer to first FCB to be copied into child's PSP
  608.  0Ah    DWORD   pointer to second FCB to be copied into child's PSP
  609.  0Eh    DWORD   (AL=01h) will hold subprogram's initial SS:SP on return
  610.  12h    DWORD   (AL=01h) will hold entry point (CS:IP) on return
  611.  
  612. Format of EXEC parameter block for AL=03h:
  613. Offset  Size    Description
  614.  00h    WORD    segment at which to load overlay
  615.  02h    WORD    relocation factor to apply to overlay if in .EXE format
  616.  
  617. Format of EXEC parameter block for FlashTek X-32:
  618. Offset  Size    Description
  619.  00h    PWORD   48-bit far pointer to environment string
  620.  06h    PWORD   48-bit far pointer to command tail string
  621.  
  622. Format of .EXE file header:
  623. Offset  Size    Description
  624.  00h  2 BYTEs   .EXE signature, either "MZ" or "ZM" (5A4Dh or 4D5Ah)
  625.  02h    WORD    number of bytes in last 512-byte page of executable
  626.  04h    WORD    total number of 512-byte pages in executable (includes any
  627.                 partial last page)
  628.  06h    WORD    number of relocation entries
  629.  08h    WORD    header size in paragraphs
  630.  0Ah    WORD    minimum paragraphs of memory to allocation in addition to
  631.                 executable's size
  632.  0Ch    WORD    maximum paragraphs to allocate in addition to executable's size
  633.  0Eh    WORD    initial SS relative to start of executable
  634.  10h    WORD    initial SP
  635.  12h    WORD    checksum (one's complement of sum of all words in executable)
  636.  14h    DWORD   initial CS:IP relative to start of executable
  637.  18h    WORD    offset within header of relocation table
  638.                 40h or greater for new-format (NE,LE,LX,W3,PE,etc.) executable
  639.  1Ah    WORD    overlay number (normally 0000h = main program)
  640. ---new executable---
  641.  1Ch  4 BYTEs   ???
  642.  20h    WORD    behavior bits
  643.  22h 26 BYTEs   reserved for additional behavior info
  644.  3Ch    DWORD   offset of new executable (NE,LE,etc) header within disk file,
  645.                 or 00000000h if plain MZ executable
  646. ---Borland TLINK---
  647.  1Ch  2 BYTEs   ??? (apparently always 01h 00h)
  648.  1Eh    BYTE    signature FBh
  649.  1Fh    BYTE    TLINK version (major in high nybble, minor in low nybble)
  650.  20h  2 BYTEs   ??? (v2.0 apparently always 72h 6Ah, v3.0+ seems always 6Ah 72h)
  651. ---ARJ self-extracting archive---
  652.  1Ch  4 BYTEs   signature "RJSX" (older versions, new signature is "aRJsfX" in
  653.                 the first 1000 bytes of the file)
  654. ---LZEXE 0.90 compressed executable---
  655.  1Ch  4 BYTEs   signature "LZ09"
  656. ---LZEXE 0.91 compressed executable---
  657.  1Ch  4 BYTEs   signature "LZ91"
  658. ---PKLITE compressed executable---
  659.  1Ch    BYTE    minor version number
  660.  1Dh    BYTE    bits 0-3: major version
  661.                 bit 4: extra compression
  662.                 bit 5: huge (multi-segment) file
  663.  1Eh  6 BYTEs   signature "PKLITE" (followed by copyright message)
  664. ---LHarc 1.x self-extracting archive---
  665.  1Ch  4 BYTEs   unused???
  666.  20h  3 BYTEs   jump to start of extraction code
  667.  23h  2 BYTEs   ???
  668.  25h 12 BYTEs   signature "LHarc's SFX "
  669. ---LHA 2.x self-extracting archive---
  670.  1Ch  8 BYTEs   ???
  671.  24h 10 BYTEs   signature "LHa's SFX " (v2.10) or "LHA's SFX " (v2.13)
  672. ---TopSpeed C 3.0 CRUNCH compressed file---
  673.  1Ch    DWORD   018A0001h
  674.  20h    WORD    1565h
  675. ---PKARCK 3.5 self-extracting archive---
  676.  1Ch    DWORD   00020001h
  677.  20h    WORD    0700h
  678. ---BSA (Soviet archiver) self-extracting archive---
  679.  1Ch    WORD    000Fh
  680.  1Eh    BYTE    A7h
  681. ---LARC self-extracting archive---
  682.  1Ch  4 BYTEs   ???
  683.  20h 11 BYTEs   "SFX by LARC "
  684. ---LH self-extracting archive---
  685.  1Ch  8 BYTEs   ???
  686.  24h  8 BYTEs   "LH's SFX "
  687. ---other linkers---
  688.  1Ch    var     optional information
  689. ---
  690.   N   N DWORDs  relocation items
  691. Notes:  if word at offset 02h is 4, it should be treated as 00h, since pre-1.10
  692.           versions of the MS linker set it that way
  693.         if both minimum and maximum allocation (offset 0Ah/0Ch) are zero, the
  694.           program is loaded as high in memory as possible
  695.         the maximum allocation is set to FFFFh by default
  696.  
  697. Format of ROM Module Header:
  698. Offset  Size    Description
  699.  00h  2 BYTEs   ROM signature 55h, AAh
  700.  02h    BYTE    size of ROM in 512-byte blocks
  701.  03h  3 BYTEs   POST initialization entry point (near JMP instruction)
  702.  06h    ROM Program Name List [array]
  703.         Offset  Size    Description
  704.          00h    BYTE    length of ROM program's name (00h if end of name list)
  705.          01h  N BYTEs   program name
  706.          N+1  3 BYTEs   program entry point (near JMP instruction)
  707.  
  708. Format of new executable header:
  709. Offset  Size    Description
  710.  00h  2 BYTEs   "NE" (4Eh 45h) signature
  711.  02h  2 BYTEs   linker version (major, then minor)
  712.  04h    WORD    offset from start of this header to entry table (see below)
  713.  06h    WORD    length of entry table in bytes
  714.  08h    DWORD   file load CRC (0 in Borland's TPW)
  715.  0Ch    BYTE    program flags
  716.                 bits 0-1 DGROUP type
  717.                   0 = none
  718.                   1 = single shared
  719.                   2 = multiple (unshared)
  720.                   3 = (null)
  721.                 bit 2:  global initialization
  722.                 bit 3:  protected mode only
  723.                 bit 4:  8086 instructions
  724.                 bit 5:  80286 instructions
  725.                 bit 6:  80386 instructions
  726.                 bit 7:  80x87 instructions
  727.  0Dh    BYTE    application flags
  728.                 bits 0-2: application type
  729.                     001 full screen (not aware of Windows/P.M. API)
  730.                     010 compatible with Windows/P.M. API
  731.                     011 uses Windows/P.M. API
  732.                 bit 3: is a Family Application (OS/2)
  733.                 bit 5: 0=executable, 1=errors in image
  734.                 bit 6: non-conforming program (valid stack is not maintained)
  735.                 bit 7: DLL or driver rather than application
  736.                         (SS:SP info invalid, CS:IP points at FAR init routine
  737.                          called with AX=module handle which returns AX=0000h
  738.                          on failure, AX nonzero on successful initialization)
  739.  0Eh    WORD    auto data segment index
  740.  10h    WORD    initial local heap size
  741.  12h    WORD    initial stack size (added to data seg, 0000h if SS <> DS)
  742.  14h    DWORD   program entry point (CS:IP), "CS" is index into segment table
  743.  18h    DWORD   initial stack pointer (SS:SP), "SS" is segment index
  744.                 if SS=automatic data segment and SP=0000h, the stack pointer is
  745.                   set to the top of the automatic data segment, just below the
  746.                   local heap
  747.  1Ch    WORD    segment count
  748.  1Eh    WORD    module reference count
  749.  20h    WORD    length of nonresident names table in bytes
  750.  22h    WORD    offset from start of this header to segment table (see below)
  751.  24h    WORD    offset from start of this header to resource table
  752.  26h    WORD    offset from start of this header to resident names table
  753.  28h    WORD    offset from start of this header to module reference table
  754.  2Ah    WORD    offset from start of this header to imported names table
  755.                 (array of counted strings, terminated with a string of length
  756.                  00h)
  757.  2Ch    DWORD   offset from start of file to nonresident names table
  758.  30h    WORD    count of moveable entry point listed in entry table
  759.  32h    WORD    file alignment size shift count
  760.                 0 is equivalent to 9 (default 512-byte pages)
  761.  34h    WORD    number of resource table entries
  762.  36h    BYTE    target operating system
  763.                 00h unknown
  764.                 01h OS/2
  765.                 02h Windows
  766.                 03h European MS-DOS 4.x
  767.                 04h Windows 386
  768.                 05h BOSS (Borland Operating System Services)
  769.  37h    BYTE    other EXE flags
  770.                 bit 0: supports long filenames
  771.                 bit 1: 2.X protected mode
  772.                 bit 2: 2.X proportional font
  773.                 bit 3: gangload area
  774.  38h    WORD    offset to return thunks or start of gangload area
  775.  3Ah    WORD    offset to segment reference thunks or length of gangload area
  776.  3Ch    WORD    minimum code swap area size
  777.  3Eh  2 BYTEs   expected Windows version (minor version first)
  778. Note:   this header is documented in detail in the Windows 3.1 SDK Programmer's
  779.           Reference, Vol 4.
  780.  
  781. Format of Codeview trailer (at end of executable):
  782. Offset  Size    Description
  783.  00h    WORD    signature 4E42h ('NB')
  784.  02h    WORD    Microsoft debug info version number
  785.  04h    DWORD   Codeview header offset
  786.  
  787. Format of new executable segment table record:
  788.  00h    WORD    offset in file (shift left by alignment shift to get byte offs)
  789.  02h    WORD    length of image in file (0000h = 64K)
  790.  04h    WORD    segment attributes (see below)
  791.  06h    WORD    number of bytes to allocate for segment (0000h = 64K)
  792. Note:   the first segment table entry is entry number 1
  793.  
  794. Bitfields for segment attributes:
  795.  bit 0  data segment rather than code segment
  796.  bit 1  unused???
  797.  bit 2  real mode
  798.  bit 3  iterated
  799.  bit 4  movable
  800.  bit 5  sharable
  801.  bit 6  preloaded rather than demand-loaded
  802.  bit 7  execute-only (code) or read-only (data)
  803.  bit 8  relocations (directly following code for this segment)
  804.  bit 9  debug info present
  805.  bits 10,11     80286 DPL bits
  806.  bit 12         discardable
  807.  bits 13-15     discard priority
  808.  
  809. Format of new executable entry table item (list):
  810. Offset  Size    Description
  811.  00h    BYTE    number of entry points (00h if end of entry table list)
  812.  01h    BYTE    segment number (00h if end of entry table list)
  813.  02h 3N BYTEs   entry records
  814.                 Offset  Size    Description
  815.                  00h    BYTE    flags
  816.                                 bit 0: exported
  817.                                 bit 1: single data
  818.                                 bits 2-7: unused???
  819.                  01h    WORD    offset within segment
  820.  
  821. Format of new executable relocation data (immediately follows segment image):
  822. Offset  Size    Description
  823.  00h    WORD    number of relocation items
  824.  02h 8N BYTEs   relocation items
  825.                 Offset  Size    Description
  826.                  00h    BYTE    relocation type
  827.                                 00h LOBYTE
  828.                                 02h BASE
  829.                                 03h PTR
  830.                                 05h OFFS
  831.                                 0Bh PTR48
  832.                                 0Dh OFFS32
  833.                  01h    BYTE    flags
  834.                                 bit 2: additive
  835.                  02h    WORD    offset within segment
  836.                  04h    WORD    target address segment
  837.                  06h    WORD    target address offset
  838.  
  839. Format of new executable resource data:
  840. Offset  Size    Description
  841.  00h    WORD    alignment shift count for resource data
  842.  02h  N RECORDs resources
  843.         Format of resource record:
  844.         Offset  Size    Description
  845.          00h    WORD    type ID
  846.                         0000h if end of resource records
  847.                         >= 8000h if integer type
  848.                         else offset from start of resource table to type string
  849.          02h    WORD    number of resources of this type
  850.          04h    DWORD   reserved for runtime use
  851.          08h  N Resources (see below)
  852. Note:   resource type and name strings are stored immediately following the
  853.           resource table, and are not null-terminated
  854.  
  855. Format of new executable resource entry:
  856. Offset  Size    Description
  857.  00h    WORD    offset in alignment units from start of file to contents of
  858.                 the resource data
  859.  02h    WORD    length of resource image in bytes
  860.  04h    WORD    flags
  861.                 bit 4: moveable
  862.                 bit 5: shareable
  863.                 bit 6: preloaded
  864.  06h    WORD    resource ID
  865.                 >= 8000h if integer resource
  866.                 else offset from start of resource table to resource string
  867.  08h    DWORD   reserved for runtime use
  868. Notes:  resource type and name strings are stored immediately following the
  869.           resource table, and are not null-terminated
  870.         strings are counted strings, with a string of length 0 indicating the
  871.           end of the resource table
  872.  
  873. Format of new executable module reference table [one bundle of entries]:
  874. Offset  Size    Description
  875.  00h    BYTE    number of records in this bundle (00h if end of table)
  876.  01h    BYTE    segment indicator
  877.                 00h unused
  878.                 FFh movable segment, segment number is in entry
  879.                 else segment number of fixed segment
  880.  02h  N RECORDs
  881.         Format of segment record
  882.         Offset  Size    Description
  883.          00h    BYTE    flags
  884.                         bit 0: entry is exported
  885.                         bit 1: entry uses global (shared) data
  886.                         bits 7-3: number of parameter words
  887.         ---fixed segment---
  888.          01h    WORD    offset
  889.         ---moveable segment---
  890.          01h  2 BYTEs   INT 3F instruction (CDh 3Fh)
  891.          03h    BYTE    segment number
  892.          05h    WORD    offset
  893. Note:   table entries are numbered starting from 1
  894.  
  895. Format of new executable resident/nonresident name table entry:
  896. Offset  Size    Description
  897.  00h    BYTE    length of string (00h if end of table)
  898.  01h  N BYTEs   ASCII text of string
  899.  N+1    WORD    ordinal number (index into entry table)
  900. Notes:  the first string in the resident name table is the module name; the
  901.           first entry in the nonresident name table is the module description
  902.         the strings are case-sensitive; if the executable was linked with
  903.           /IGNORECASE, all strings are in uppercase
  904.  
  905. Format of Linear Executable (enhanced mode executable) header:
  906. Offset  Size    Description
  907.  00h  2 BYTEs   "LE" (4Ch 45h) signature (Windows)
  908.                 "LX" (4Ch 58h) signature (OS/2)
  909.  02h    BYTE    byte order (00h = little-endian, nonzero = big-endian)
  910.  03h    BYTE    word order (00h = little-endian, nonzero = big-endian)
  911.  04h    DWORD   executable format level
  912.  08h    WORD    CPU type (see also INT 15/AH=C9h)
  913.                 01h Intel 80286 or upwardly compatible
  914.                 02h Intel 80386 or upwardly compatible
  915.                 03h Intel 80486 or upwardly compatible
  916.                 04h Intel Pentium (80586) or upwardly compatible
  917.                 20h Intel i860 (N10) or compatible
  918.                 21h Intel "N11" or compatible
  919.                 40h MIPS Mark I (R2000, R3000) or compatible
  920.                 41h MIPS Mark II (R6000) or compatible
  921.                 42h MIPS Mark III (R4000) or compatible
  922.  0Ah    WORD    target operating system
  923.                 01h OS/2
  924.                 02h Windows
  925.                 03h European DOS 4.0
  926.                 04h Windows 386
  927.  0Ch    DWORD   module version
  928.  10h    DWORD   module type
  929.                 bit 2: initialization (only for DLLs)
  930.                         0 = global
  931.                         1 = per-process
  932.                 bit 4: no internal fixups in executable image
  933.                 bit 5: no external fixups in executable image
  934.                 bits 8,9,10:
  935.                         0 = unknown
  936.                         1 = incompatible with PM windowing \
  937.                         2 = compatible with PM windowing    > (only for
  938.                         3 = uses PM windowing API          /    programs)
  939.                 bit 13: module not loadable (only for programs)
  940.                 bits 17,16,15: module type
  941.                         000 program
  942.                         001 library (DLL)
  943.                         011 protected memory library module
  944.                         100 physical device driver
  945.                         110 virtual device driver
  946.                 bit 30: per-process library termination
  947.                         (requires valid CS:EIP, can't be set for .EXE)
  948.  14h    DWORD   number of memory pages
  949.  18h    Initial CS:EIP
  950.         DWORD   object number
  951.         DWORD   offset
  952.  20h    Initial SS:ESP
  953.         DWORD   object number
  954.         DWORD   offset
  955.  28h    DWORD   memory page size
  956.  2Ch    DWORD   (Windows LE) bytes on last page
  957.                 (OS/2 LX) page offset shift count
  958.  30h    DWORD   fixup section size
  959.  34h    DWORD   fixup section checksum
  960.  38h    DWORD   loader section size
  961.  3Ch    DWORD   loader section checksum
  962.  40h    DWORD   offset of object table (see below)
  963.  44h    DWORD   object table entries
  964.  48h    DWORD   object page map table offset
  965.  4CH    DWORD   object iterate data map offset
  966.  50h    DWORD   resource table offset
  967.  54h    DWORD   resource table entries
  968.  58h    DWORD   resident names table offset
  969.  5Ch    DWORD   entry table offset
  970.  60h    DWORD   module directives table offset
  971.  64h    DWORD   Module Directives entries
  972.  68h    DWORD   Fixup page table offset
  973.  6Ch    DWORD   Fixup record table offset
  974.  70h    DWORD   imported modules name table offset
  975.  74h    DWORD   imported modules count
  976.  78h    DWORD   imported procedures name table offset
  977.  7Ch    DWORD   per-page checksum table offset
  978.  80h    DWORD   data pages offset
  979.  84h    DWORD   preload page count
  980.  88h    DWORD   non-resident names table offset
  981.  8Ch    DWORD   non-resident names table length
  982.  90h    DWORD   non-resident names checksum
  983.  94h    DWORD   automatic data object
  984.  98h    DWORD   debug information offset
  985.  9Ch    DWORD   debug information length
  986.  A0h    DWORD   preload instance pages number
  987.  A4h    DWORD   demand instance pages number
  988.  A8h    DWORD   extra heap allocation
  989.  ACh 20 BYTEs   reserved
  990.  C0h    WORD    device ID (MS-Windows VxD only)
  991.  C2h    WORD    DDK version (MS-Windows VxD only)
  992. Note:   used by EMM386.EXE, QEMM, and Windows 3.0 Enhanced Mode drivers
  993.  
  994. Format of object table entry:
  995. Offset  Size    Description
  996.  00h    DWORD   virtual size in bytes
  997.  04h    DWORD   relocation base address
  998.  08h    DWORD   object flags (see below)
  999.  0Ch    DWORD   page map index
  1000.  10h    DWORD   page map entries
  1001.  14h  4 BYTEs   reserved??? (apparently always zeros)
  1002.  
  1003. Bitfields for object flags:
  1004.  bit 0  readable
  1005.  bit 1  writable
  1006.  bit 2  executable
  1007.  bit 3  resource
  1008.  bit 4  discardable
  1009.  bit 5  shared
  1010.  bit 6  preloaded
  1011.  bit 7  invalid
  1012.  bit 8-9 type
  1013.         00 normal
  1014.         01 zero-filled
  1015.         10 resident
  1016.         11 resident and contiguous
  1017.  bit 10 resident and long-lockable
  1018.  bit 11 reserved
  1019.  bit 12 16:16 alias required
  1020.  bit 13 "BIG" (Huge: 32-bit)
  1021.  bit 14 conforming
  1022.  bit 15 "OBJECT_I/O_PRIVILEGE_LEVEL"
  1023.  bits 16-31 reserved
  1024.  
  1025. Format of object page map table entry:
  1026. Offset  Size    Description
  1027.  00h    BYTE    ??? (usually 00h)
  1028.  01h    WORD    (big-endian) index to fixup table
  1029.                 0000h if no relocation info
  1030.  03h    BYTE    type (00h hard copy in file, 03h some relocation needed)
  1031.  
  1032. Format of resident names table entry:
  1033. Offset  Size    Description
  1034.  00h    BYTE    length of name
  1035.  01h  N BYTEs   name
  1036.  N+1  3 BYTEs   ???
  1037.  
  1038. Format of LE linear executable entry table:
  1039. Offset  Size    Description
  1040.  00h    BYTE    number of entries in table
  1041.  01h 10 BYTEs per entry
  1042.                 Offset  Size    Description
  1043.                  00h    BYTE    bit flags
  1044.                                 bit 0: non-empty bundle
  1045.                                 bit 1: 32-bit entry
  1046.                  01h    WORD    object number
  1047.                  03h    BYTE    entry type flags
  1048.                                 bit 0: exported
  1049.                                 bit 1: uses single data rather than instance
  1050.                                 bit 2: reserved
  1051.                                 bits 3-7: number of stack parameters
  1052.                  04h    DWORD   offset of entry point
  1053.                  08h  2 BYTEs   ???
  1054. Note:   empty bundles (bit flags at 00h = 00h) are used to skip unused indices,
  1055.           and do not contain the remaining nine bytes
  1056.  
  1057. Format of LX linear executable entry table [array]:
  1058. Offset  Size    Description
  1059.  00h    BYTE    number of bundles following (00h = end of entry table)
  1060.  01h    BYTE    bundle type
  1061.                 00h empty
  1062.                 01h 16-bit entry
  1063.                 02h 286 callgate entry
  1064.                 03h 32-bit entry
  1065.                 04h forwarder entry
  1066.                 bit 7 set if additional parameter typing information is present
  1067. ---bundle type 00h---
  1068.  no additional fields
  1069. ---bundle type 01h---
  1070.  02h    WORD    object number
  1071.  04h    BYTE    entry flags
  1072.                 bit 0: exported
  1073.                 bits 7-3: number of stack parameters
  1074.  05h    WORD    offset of entry point in object (shifted by page size shift)
  1075. ---bundle type 02h---
  1076.  02h    WORD    object number
  1077.  04h    BYTE    entry flags
  1078.                 bit 0: exported
  1079.                 bits 7-3: number of stack parameters
  1080.  05h    WORD    offset of entry point in object
  1081.  07h    WORD    reserved for callgate selector (used by loader)
  1082. ---bundle type 03h---
  1083.  02h    WORD    object number
  1084.  04h    BYTE    entry flags
  1085.                 bit 0: exported
  1086.                 bits 7-3: number of stack parameters
  1087.  05h    DWORD   offset of entry point in object
  1088. ---bundle type 04h---
  1089.  02h    WORD    reserved
  1090.  04h    BYTE    forwarder flags
  1091.                 bit 0: import by ordinal
  1092.                 bits 7-1 reserved
  1093.  05h    WORD    module ordinal
  1094.                 (forwarder's index into Import Module Name table)
  1095.  07h    DWORD   procedure name offset or import ordinal number
  1096. Note:   all fields after the first two bytes are repeated N times
  1097.  
  1098. Bitfields for linear executable fixup type:
  1099.  bit 7  ordinal is BYTE rather than WORD
  1100.  bit 6  16-bit rather than 8-bit object number/module ordinal
  1101.  bit 5  addition with DWORD rather than WORD
  1102.  bit 4  relocation info has size with new two bytes at end
  1103.  bit 3  reserved (0)
  1104.  bit 2  set if add to destination, clear to replace destination
  1105.  bits 1-0       type
  1106.                 00 internal fixup
  1107.                 01 external fixup, imported by ordinal
  1108.                 10 external fixup, imported by name
  1109.                 11 internal fixup via entry table
  1110.  
  1111. Format of linear executable fixup record:
  1112. Offset  Size    Description
  1113.  00h    BYTE    type
  1114.                 bits 7-4: modifier (0001 single, 0011 multiple)
  1115.                 bits 3-0: type
  1116.                         0000 byte offset
  1117.                         0010 word segment
  1118.                         0011 16-bit far pointer (DWORD)
  1119.                         0101 16-bit offset
  1120.                         0110 32-bit far pointer (PWORD)
  1121.                         0111 32-bit offset
  1122.                         1000 near call or jump, WORD/DWORD based on seg attrib
  1123.  01h    BYTE    linear executable fixup type (see above)
  1124. ---if single type---
  1125.  02h    WORD    offset within page
  1126.  04h    relocation information
  1127.         ---internal fixup---
  1128.         BYTE    object number
  1129.         ---external,ordinal---
  1130.         BYTE    one-based module number in Import Module table
  1131.         BYTE/WORD ordinal number
  1132.         WORD/DWORD value to add (only present if modifier bit 4 set)
  1133.         ---external,name---
  1134.         BYTE    one-based module number in Import Module table
  1135.         WORD    offset in Import Procedure names
  1136.         WORD/DWORD value to add (only present if modifier bit 4 set)
  1137. ---if multiple type---
  1138.  02h    BYTE    number of items
  1139.  03h    var     relocation info as for "single" type (see above)
  1140.       N WORDs   offsets of items to relocate
  1141.  
  1142. Format of old Phar Lap .EXP file header:
  1143. Offset  Size    Description
  1144.  00h  2 BYTEs   "MP" (4Dh 50h) signature
  1145.  02h    WORD    remainder of image size / page size (page size = 512h)
  1146.  04h    WORD    size of image in pages
  1147.  06h    WORD    number of relocation items
  1148.  08h    WORD    header size in paragraphs
  1149.  0Ah    WORD    minimum number of extra 4K pages to be allocated at the end
  1150.                 of program, when it is loaded
  1151.  0Ch    WORD    maximum number of extra 4K pages to be allocated at the end
  1152.                 of program, when it is loaded
  1153.  0Eh    DWORD   initial ESP
  1154.  12h    WORD    word checksum of file
  1155.  14h    DWORD   initial EIP
  1156.  18h    WORD    offset of first relocation item
  1157.  1Ah    WORD    overlay number
  1158.  1Ch    WORD    ??? (wants to be 1)
  1159.  
  1160. Format of new Phar Lap .EXP file header:
  1161. Offset  Size    Description
  1162.  00h  2 BYTEs   signature ("P2" for 286 .EXP executable, "P3" for 386 .EXP)
  1163.  02h    WORD    level (01h flat-model file, 02h multisegmented file)
  1164.  04h    WORD    header size
  1165.  06h    DWORD   file size in bytes
  1166.  0Ah    WORD    checksum
  1167.  0Ch    DWORD   offset of run-time parameters within file
  1168.  10h    DWORD   size of run-time parameters in bytes
  1169.  14h    DWORD   offset of relocation table within file
  1170.  18h    DWORD   size of relocation table in bytes
  1171.  1Ch    DWORD   offset of segment information table within file
  1172.  20h    DWORD   size of segment information table in bytes
  1173.  24h    WORD    size of segment information table entry in bytes
  1174.  26h    DWORD   offset of load image within file
  1175.  2Ah    DWORD   size of load image on disk
  1176.  2Eh    DWORD   offset of symbol table within file
  1177.  32h    DWORD   size of symbol table in bytes
  1178.  36h    DWORD   offset of GDT within load image
  1179.  3Ah    DWORD   size of GDT in bytes
  1180.  3Eh    DWORD   offset of LDT within load image
  1181.  42h    DWORD   size of LDT in bytes
  1182.  46h    DWORD   offset of IDT within load image
  1183.  4Ah    DWORD   size of IDT in bytes
  1184.  4Eh    DWORD   offset of TSS within load image
  1185.  52h    DWORD   size of TSS in bytes
  1186.  56h    DWORD   minimum number of extra bytes to be allocated at end of program
  1187.                 (level 1 executables only)
  1188.  5Ah    DWORD   maximum number of extra bytes to be allocated at end of program
  1189.                 (level 1 executables only)
  1190.  5Eh    DWORD   base load offset (level 1 executables only)
  1191.  62h    DWORD   initial ESP
  1192.  66h    WORD    initial SS
  1193.  68h    DWORD   initial EIP
  1194.  6Ch    WORD    initial CS
  1195.  6Eh    WORD    initial LDT
  1196.  70h    WORD    initial TSS
  1197.  72h    WORD    flags
  1198.                 bit 0: load image is packed
  1199.                 bit 1: 32-bit checksum is present
  1200.                 bits 4-2: type of relocation table
  1201.  74h    DWORD   memory requirements for load image
  1202.  78h    DWORD   32-bit checksum (optional)
  1203.  7Ch    DWORD   size of stack segment in bytes
  1204.  80h 256 BYTEs  reserved (0)
  1205.  
  1206. Format of Phar Lap segment information table entry:
  1207. Offset  Size    Description
  1208.  00h    WORD    selector number
  1209.  02h    WORD    flags
  1210.  04h    DWORD   base offset of selector
  1211.  08h    DWORD   minimum number of extra bytes to be allocated to the segment
  1212.  
  1213. Format of 386|DOS-Extender run-time parameters:
  1214. Offset  Size    Description
  1215.  00h  2 BYTEs   signature "DX" (44h 58h)
  1216.  02h    WORD    minimum number of real-mode params to leave free at run time
  1217.  04h    WORD    maximum number of real-mode params to leave free at run time
  1218.  06h    WORD    minimum interrupt buffer size in KB
  1219.  08h    WORD    maximum interrupt buffer size in KB
  1220.  0Ah    WORD    number of interrupt stacks
  1221.  0Ch    WORD    size in KB of each interrupt stack
  1222.  0Eh    DWORD   offset of byte past end of real-mode code and data
  1223.  12h    WORD    size in KB of call buffers
  1224.  14h    WORD    flags
  1225.                 bit 0: file is virtual memory manager
  1226.                 bit 1: file is a debugger
  1227.  16h    WORD    unprivileged flag (if nonzero, executes at ring 1, 2, or 3)
  1228.  18h 104 BYTEs  reserved (0)
  1229.  
  1230. Format of Phar Lap repeat block header:
  1231. Offset  Size    Description
  1232.  00h    WORD    byte count
  1233.  02h    BYTE    repeat string length
  1234.  
  1235. Format of Borland debugging information header (following load image):
  1236. Offset  Size    Description
  1237.  00h    WORD    signature 52FBh
  1238.  02h    WORD    version ID
  1239.  04h    DWORD   size of name pool in bytes
  1240.  08h    WORD    number of names in namem pool
  1241.  0Ah    WORD    number of type entries
  1242.  0Ch    WORD    number of structure members
  1243.  0Eh    WORD    number of symbols
  1244.  10h    WORD    number of global symbols
  1245.  12h    WORD    number of modules
  1246.  14h    WORD    number of locals (optional)
  1247.  16h    WORD    number of scopes in table
  1248.  18h    WORD    number of line-number entries
  1249.  1Ah    WORD    number of include files
  1250.  1Ch    WORD    number of segment records
  1251.  1Eh    WORD    number of segment/file correlations
  1252.  20h    DWORD   size of load image after removing uninitialized data and debug
  1253.                 info
  1254.  24h    DWORD   debugger hook; pointer into debugged program whose meaning
  1255.                 depends on program flags
  1256.  28h    BYTE    program flags
  1257.                 bit 0: case-sensitive link
  1258.                 bit 1: pascal overlay program
  1259.  29h    WORD    no longer used
  1260.  2Bh    WORD    size of data pool in bytes
  1261.  2Dh    BYTE    padding
  1262.  2Eh    WORD    size of following header extension (currently 00h, 10h, or 20h)
  1263.  30h    WORD    number of classes
  1264.  32h    WORD    number of parents
  1265.  34h    WORD    number of global classes (currently unused)
  1266.  36h    WORD    number of overloads (currently unused)
  1267.  38h    WORD    number of scope classes
  1268.  3Ah    WORD    number of module classes
  1269.  3Ch    WORD    number of coverage offsets
  1270.  3Eh    DWORD   offset relative to symbol base of name pool
  1271.  42h    WORD    number of browser information records
  1272.  44h    WORD    number of optimized symbol records
  1273.  46h    WORD    debugging flags
  1274.  48h  8 BYTEs   padding
  1275. Note:   additional information on the Borland debugging info may be found in
  1276.           Borland's Open Architecture Handbook
  1277.