pTAL Conversion Guide

Equivalenced Variables
pTAL Conversion Guide527302-002
12-8
Declaring Equivalenced Variables
Declaring Equivalenced Variables
Topics:
Considerations on page 12-8
Equivalencing Standard Pointers to Indirect Items on page 12-9
Equivalencing Extended Pointers to Extended Items on page 12-10
Equivalenced Variable Must Fit Within Previous Variable on page 12-11
Declaring Structures in Equivalenced Declarations on page 12-12
Declaring Pointers in Equivalenced Declarations on page 12-13
Considerations
You can equivalence standard pointers to indirect arrays and indirect structures,
but you can only read the value of the pointer. You cannot store an address into the
pointer. You can, however, read or write the data to which the pointer points.
You can equivalence extended pointers to extended arrays and extended
structures, but you can only read the value of the pointer. You cannot store an
address into the pointer. You can, however, read or write the data to which the
pointer points.
The address types BADDR, WADDR, CBADDR, CWADDR, SGXBADDR,
SGXWADDR, and PROCADDR are 16 bits for TNS architecture, but 32 bits for
native architecture. In an equivalenced declaration, if either the equivalenced
variable or the previous variable is a pointer or a variable whose data type is an
address type, the number of bits in the equivalenced variable must be less than or
equal to the number of bits in the previous variable in TNS and native
architectures.
STRUCT b = a;
BEGIN
INT(32) z;
END;
STRUCT c[0:3];
BEGIN
INT i;
INT j;
END;
STRUCT d[0:3] = c;
BEGIN
INT(32) z;
END;
Example 12-3. Equivalenced Structure Declarations (page 2 of 2)