pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
STRING s; ! ERROR: BADDR pointer is not valid
END;
NOTE: The address types, EXT32ADDR, EXT64ADDR, PROC32ADDR, and PROC64ADDR are
64-bit addressing functionality added to the EpTAL compiler starting with SPR T0561H01^AAP.
For more information, see Appendix E, “64-bit Addressing Functionality” (page 531).
Topics:
• Alignment of Fields (page 131)
• Optimizing Structure Layouts (page 131)
• Structure Length (page 132)
• Alignment of UNSIGNED(17-31) Fields (page 133)
Alignment of Fields
If a field in a SHARED8 structure is not well-aligned, you must explicitly declare filler to force the
field to be well-aligned.
Example 65 Filler Forcing Alignment in a SHARED8 Structure
STRUCT s FIELDALIGN(SHARED8);
BEGIN
INT a; ! 0 a uses 2 bytes
FILLER 2; ! 2 Force b to a 4-byte offset
INT(32) b; ! 4 b uses 4 bytes
STRING c [0:2]; ! 8 c uses 3 bytes
FILLER 5; ! 11 Force d to an 8-byte offset
FIXED d; ! 16 d uses 8 bytes
INT(32) e[0:1]; ! 24 e uses 8 bytes
INT f; ! 32 f uses 2 bytes
UNSIGNED(5) g; ! 34 g uses 5 bits
BIT_FILLER 11; ! Force h to a 4-byte offset
UNSIGNED(17) h; ! 36 h uses 2 bytes plus 1 bit
UNSIGNED(15) i; ! 38 i uses 15 bits
END; ! Total structure length: 40 bytes
The first filler item (FILLER 2) forces b to begin at a 4-byte address. The second filler item (FILLER
5) forces d to begin at an 8-byte address. The third filler item (BIT_FILLER 11) forces h to begin at
a 4-byte address.
Optimizing Structure Layouts
You do not need to declare filler items in a SHARED2 structure to align its fields. If filler is
needed—for example to align bit fields, string fields, or fields that follow bit fields and string
fields—the compiler inserts the needed filler.
SHARED8 Parameter 131