DDL Alignment Rules
Data Definition Language (DDL) Reference Manual — 426798-002
H- 3
C_MATCH_HISTORIC_TAL Alignment Rules
C_MATCH_HISTORIC_TAL Alignment Rules
When you specify the CFIELDALIGN_MATCHED2 compiler command, DDL uses the
following alignment rules:
•
If a substructure starts on an odd byte boundary or has an odd length, and refers
to a previously defined structure, DDL inserts one or more fillers to word-align the
substructure and make its length even.
•
If a substructure defined in line starts on an odd byte boundary, DDL aligns the
data on an odd byte boundary.
The C_MATCH_HISTORIC_TAL command allows members of a structure to have
consecutive byte or word addresses. If the remaining byte in a two-byte word is not
large enough to accommodate the next member, then DDL assigns the next word-
aligned address. This condition also applies to a substructure that is declared inline,
using the first member of the substructure.
FIELDALIGN_SHARED8 Alignment Rules
When you specify the FIELDALIGN_SHARED8 compiler command, DDL uses the
following alignment rules:
•
The offset of each field (other than bit fields) in the structure from the base of the
structure must begin at an address that is an integral multiple of the width of
the field.
•
The offset of a substructure field must be an integral multiple of the widest field in
the substructure.
•
The offset of an array must be an integral multiple of an element of the array.
•
Bit fields are packed from the most significant bit to the least significant bit in a
word and can not overlap a 16-bit word boundary.
•
Explicit fillers are required to ensure that the components are properly aligned.
•
The structure must begin at an address that is an integral multiple of the width of
the widest field in the structure.
•
The size of a structure must be an integral multiple of its alignment. Explicit fillers
might be required to ensure this.
•
The minimum alignment for a struct or substruct is 16 bits.
•
The possible values for alignment are 1,2,4, or 8 bytes.