pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-4
Declaring Pointers
REFALIGNED
Specifies the alignment of the variables or structures that identifier
references.
2
specifies that the variables and structures referenced by identifier are aligned as
they would be on TNS architecture and might not be well-aligned on native
architecture.
8
specifies that the variables and structures will be well-aligned for use on native
architecture.
Pointers declared with reference alignment of either 2 or 8 are well-aligned on TNS
architecture.
initialization
See Operations on Addresses on page 10-17 for initialization of address-type
variables. See the TAL Reference Manual for other initialization information.
Considerations:
Specify referral only for pointers to structures.
For structure pointers, type must be either STRING or INT.
For nonstructure pointers, the default for REFALIGNED is the value you specify in
the REFALIGNED compiler directive.
For structure pointers, the default reference alignment is the field alignment of
referral. Reference alignment defaults to 2 if the field alignment of referral is
SHARED2 and defaults to 8 if the field alignment of referral is SHARED8. If the
field alignment of referral is AUTO, the default reference alignment of the pointer is
optimal for the architecture on which your program will run. The REFALIGNED
compiler directive does not apply to structure pointers.
For most situations, you can use the .SGX indirection symbol. You might need to
use the .SG indirection symbol only if you use certain TNS instructions—for
example, time list instructions—which require that pointers to system data be 16
bits.
For more information on reference alignment, see Section 5, Data Allocation.