pTAL Reference Manual (H06.03+)
Structures
HP pTAL Reference Manual—523746-005
9-8
Differences Between PLATFORM and AUTO
Specify FIELDALIGN(AUTO) for structures that are not used to exchange data
between processes.
Do not assume that fields of an AUTO structure are contiguous in memory. The
compilers insert filler where required for optimal alignment.
Pointer fields and nonpointer fields in structures declared with AUTO field alignment
can be any address type or data type, respectively.
TAL, pTAL, and C lay out AUTO structures differently.
Differences Between PLATFORM and AUTO
PLATFORM structures and substructures can contain UNSIGNED and STRING items
within a 2-byte word. In AUTO structures and substructures, STRING items and
UNSIGNED items are not allocated within a 2-byte word.
PLATFORM structures and substructures can contain an odd number of bytes. AUTO
(and SHARED8) structures must contain an even number of bytes. pTAL adds an extra
byte at the end of AUTO structures if, without the byte, the structure would contain an
odd number of bytes.
The length of PLATFORM structures or substructures that contains an UNSIGNED
item must be an integral multiple of four bytes. pTAL adds extra bytes, as needed, to
the end of such structures and substructures.
Field and Base Alignment
The field alignment of a structure specifies the offsets at which fields of the structure
must begin relative to the base of the structure. A scalar field is well-aligned when its
byte offset is an integral multiple of its width. A substructure is well-aligned when the
offset of its base, relative to its encompassing structure, is an integral multiple of its
widest field.
Use the FIELDALIGN clause to specify how you want pTAL to align the fields in the
structure. For more information, see FIELDALIGN Clause
on page 9-20.
Topics:
•
Base Alignment on page 9-9
•
Structure Alignment Examples on page 9-9










