17.3 EXEHDR Output: DOS Executable File

The EXEHDR output for a DOS executable file appears as follows:

.EXE size (bytes)

Packed .EXE file

Magic number:

Bytes on last page:

Pages in file:

Relocations:

Paragraphs in header:

Extra paragraphs needed:

Extra paragraphs wanted:

Initial stack location:

Word checksum:

Entry point:

Relocation table address:

Memory needed:

The meaning of each field is described in the following list:

.EXE size (bytes)

Gives the size of the file on disk.

Packed .EXE file

Is displayed only if the file is packed.

Magic number:

Tells the operating-system loader the format of the header.

Bytes on last page:

Tells the loader how much data exists in the last page on disk.

Pages in file:

Gives the number of whole 512-byte pages in the file on disk. If the program contains overlays, this field shows the number of pages in the root.

Relocations:

Tells the loader the number of entries in the relocation table.

Paragraphs in header:

Gives the size of the header in 16-byte paragraphs. This represents the offset of the load image within the file.

Extra paragraphs needed:

Tells the loader the required minimum number of paragraphs of memory in addition to the image size. The image size is equal to Bytes on last page + (Pages in file x 512).

Extra paragraphs wanted:

Tells the loader the number of paragraphs of memory above the size on disk requested for loading the program. This value is set by LINK's /CPARM option.

Initial stack location:

Gives the address (SS:SP) of the DOS program's stack.

Word checksum:

Confirms for the loader that the file is a valid executable file.

Entry point:

Gives the start address.

Relocation table address:

Gives the location of the table of relocation pointers as an offset from the beginning of the file.

Memory needed:

Tells the loader the total memory needed to load the application. The value in this field is equal to (Extra paragraphs needed x 16) + .EXE size (bytes).