TAL Programmer's Guide
Using Structure Pointers
Using Pointers
096254 Tandem Computers Incorporated 9–13
Initializing
Structure Pointers
To initialize a pointer when you declare it, specify the assignment operator after the
identifier, followed by an initialization expression.
The addressing mode and STRING or INT attribute of the structure pointer determine
the kind of addresses the pointer can contain, as described in Table 9-3.
Table 9-3. Addresses in Structure Pointers
Addressing
Mode
STRING or
INT Attribute Kind of Addresses
Standard STRING
*
16-bit byte address of a substructure, STRING simple variable, or
STRING array declared in a structure located in the lower
32K-word area of the user data segment
Standard INT
**
16-bit word address of any structure item located anywhere in the
user data segment
Extended STRING
*
32-bit byte address of any structure item located in any segment,
normally in the automatic extended data segment
Extended INT
**
32-bit byte address of any structure item located in any segment,
normally in the automatic extended data segment
*
If the pointer is the source in a move statement or group comparison expression that omits a
count-unit, the count-unit is BYTES.
**
If the pointer is the source in a move statement or group comparison expression that omits a
count-unit, the count-unit is WORDS.
Initializing Global
Structure Pointers
At the global level, you can initialize structure pointers only with constant expressions,
as described in “Initializing Global Simple Pointers” earlier in this section.
Standard Pointers
You can initialize a standard structure pointer with the address of a structure
occurrence:
STRUCT struct_a[0:2]; !Declare STRUCT_A
BEGIN
INT var;
END;
INT .struct_ptr (struct_a) := @struct_a[1];
!Declare STRUCT_PTR; initialize
! it with address of
! STRUCT_A[1]