TAL Programmer's Guide

Using Structure Pointers
Using Pointers
9–12 096254 Tandem Computers Incorporated
Using Structure
Pointers
A structure pointer is a variable that you associate with a particular structure layout.
You must store the memory address of a structure in the structure pointer before you
access the data to which it points. You can store an address by initializing the pointer
when you declare it or by assigning an address to it later in an assignment statement.
When you refer to a structure pointer identifier in expressions, you access the structure
whose address is stored in the structure pointer.
Declaring
Structure Pointers
To declare a structure pointer, specify:
STRING or INT attribute, as described in Table 9-3
An identifier, preceded by an indirection symbol (. or .EXT)
A referral that associates the structure pointer with a structure layout—enclose in
parentheses the identifier of one of the following:
An existing definition structure, template structure, or referral structure
An existing structure pointer
The encompassing structure if this structure pointer is a structure item
To declare a standard structure pointer, use the standard indirection symbol (.) and
enclose a referral in parentheses:
INT .struct_ptr (prev_struct);
To declare an extended structure pointer, use the extended indirection symbol (.EXT)
and enclose a referral in parentheses:
INT .EXT xstruct_ptr (prev_struct);
Place extended pointer declarations preceding other global or local declarations. The
compiler emits more efficient machine code if it can store extended pointers between
G[0] and G[63] or between L[0] and L[63].