pTAL Reference Manual (H06.03+)
Structures
HP pTAL Reference Manual—523746-005
9-28
REFALIGNED Clause
The alignment of a structure pointer is the alignment specified in a REFALIGNED
clause if present, or if not present, by the field alignment of the structure it references.
The REFALIGNED compiler directive does not affect the reference alignment of
structure pointers. It is used only for pointers to nonstructure data.
You can specify the REFALIGNED clause on any pointer field. In Example 9-23 on
page 9-28, field d is a 32-bit pointer in pTAL and is valid only if the field alignment of
structure s is AUTO or PLATFORM.
The same syntax and semantics of fields and pointer fields declared with a
REFALIGNED clause is the same as that of variables and pointers declared with a
REFALIGNED clause, respectively.
Topics:
•
REFALIGNED Clause on page 9-28
•
Default Reference Alignment on page 9-29
•
REFALIGNED(2) on page 9-29
•
REFALIGNED(8) on page 9-31
•
Code Generation for Structure References on page 9-32
REFALIGNED Clause
In a SHARED2 or SHARED8 structure, you can include only pointers whose address
type is SGBADDR, SGWADDR, or EXTADDR. Pointers whose address type is any
other type are 16 bits in TAL, but 32 bits in pTAL.
Similarly, if the data type of a nonpointer field in a SHARED2 and SHARED8 structure
is an address type, its type must be SGBADDR, SGWADDR, or EXTADDR.
Example 9-23. REFALIGNED Clause With Structure Pointers
STRUCT s;
BEGIN
INT .d REFALIGNED(2); ! Standard pointer with REFALIGNED
! clause
INT. EXT e REFALIGNED(8); ! An extended pointer
END;
Example 9-24. REFALIGNED Clause
STRUCT s FIELDALIGN(SHARED2);
BEGIN
INT i; ! OK: i is a simple variable
INT .j; ! ERROR: j's address type is WADDR
BADDR b; ! ERROR: b's data type is BADDR
END;










