pTAL Reference Manual (H06.08+)

Equivalenced Variables
HP pTAL Reference Manual523746-006
11-22
FIELDALIGN Clause
FIELDALIGN Clause
The FIELDALIGN clause specifies the alignment of the fields of a structure and the
alignment of the structure itself in memory. You can use an equivalenced declaration to
create two layouts for the same area, one optimized for TAL programs on TNS
architecture and the other optimized for pTAL programs on TNS/R or TNS/E
architecture. Declare the pTAL structure first.
In Example 11-13 on page 11-22, structures a and b declare the same fields, but a
specifies FIELDALIGN(SHARED8), the optimal alignment for pTAL, whereas b
specifies FIELDALIGN(SHARED2), the alignment for TAL. pTAL generates fast code
for references to a.i, but conservative code for references to b.i
For more information about using the FIELDALIGN clause, see Section 9, Structures.
System Global Equivalenced Variable
Declarations
System global equivalencing associates a global, local, or sublocal identifier with a
location that is relative to the base address. You can declare the following
equivalenced variables for either system global ('SG') or extended system global
('SGX') addresses:
Equivalenced Simple Variable on page 11-23
Equivalenced Definition Structure on page 11-24
Equivalenced Referral Structure on page 11-25
Equivalenced Simple Pointer on page 11-27
Equivalenced Structure Pointer on page 11-28
Example 11-13. FIELDALIGN Clause in Structured Equivalenced Variables
STRUCT a FIELDALIGN(SHARED8);
BEGIN
INT i;
INT j;
END;
STRUCT b FIELDALIGN(SHARED2) = a;
BEGIN
INT i;
INT j;
END;
Note. Only procedures that operate in privileged mode can access system global data.