6.2.2 Segment Table

The segment table contains information that describes each segment in an executable file. This information includes the segment length, segment type, and segment-relocation data. The following list summarizes the values found in the segment table (the locations are relative to the beginning of each entry):

Location Description

00h Specifies the offset, in sectors, to the segment data (relative to the beginning of the file). A value of zero means no data exists.
02h Specifies the length, in bytes, of the segment, in the file. A value of zero indicates that the segment length is 64K, unless the selector offset is also zero.
04h Specifies flags that describe the contents of the executable file. This value can be one or more of the following:
Bit Meaning

0 If this bit is set, the segment is a data segment. Otherwise, the segment is a code segment.
1 If this bit is set, the loader has allocated memory for the segment.
2 If this bit is set, the segment is loaded.
3 Reserved.
4 If this bit is set, the segment type is MOVEABLE. Otherwise, the segment type is FIXED.
5 If this bit is set, the segment type is PURE or SHAREABLE. Otherwise, the segment type is IMPURE or NONSHAREABLE.
6 If this bit is set, the segment type is PRELOAD. Otherwise, the segment type is LOADONCALL.
7 If this bit is set and the segment is a code segment, the segment type is EXECUTEONLY. If this bit is set and the segment is a data segment, the segment type is READONLY.
8 If this bit is set, the segment contains relocation data.
9 Reserved.
10 Reserved.
11 Reserved.
12 If this bit is set, the segment is discardable.
13 Reserved.
Location Description

Bit Meaning

14 Reserved.
15 Reserved.

06h Specifies the minimum allocation size of the segment, in bytes. A value of zero indicates that the minimum allocation size is 64K.