A segment is a block of code or data with attributes the linker needs. SEGDEF records define them, and other records refer to them by index, counted from 1 in order of appearance.
SEGDEF (0x98, 0x99)
| Field | Size | Meaning |
|---|---|---|
| ACBP | 1 | The segment’s attributes; see below |
| Frame number | 2 | Only when the alignment is absolute: the paragraph number |
| Offset | 1 | Only when the alignment is absolute: the offset in that frame |
| Length | 2 or 4 | The size, with B set and a value of 0 meaning 64 KB, or 4 GB in the 32-bit form |
| Segment name | index | An index into the LNAMES |
| Class name | index | An index into the LNAMES, such as CODE or DATA |
| Overlay name | index | An index into the LNAMES, ignored by modern linkers |
The ACBP byte
| Bits | Name | Meaning |
|---|---|---|
| 7–5 | A | Alignment: 0 absolute, 1 byte, 2 word, 3 paragraph, 4 page (256 bytes), 5 double word |
| 4–2 | C | Combination: 0 private, 2 and 4 and 7 public, 5 stack, 6 common |
| 1 | B | Big: the length field holds exactly 64 KB (or 4 GB) when it is 0 |
| 0 | P | The segment uses 32-bit addressing |
GRPDEF (0x9A)
A group lets several segments share one base address, so that a segment register can reach them all, as DGROUP does for data.
+0Group name: an index into the LNAMESindex…for each segment: 0xFF, then its SEGDEF index1 byte, index