TAL Reference Manual

Pointers
TAL Reference Manual526371-001
9-7
Examples of Structure Pointer Declarations
Furthermore, the kind of expression you can specify for the address depends on the
level at which you declare the pointer:
At the global level, use a constant expression. See also Global Standard Pointer
Initializations on page 9-3.
At the local or sublocal level, you can use any arithmetic expression.
If the expression is the address of a structure with an index, the structure pointer points
to a particular occurrence of the structure. If the expression is the address of an array,
with or without an index, you impose the structure on top of the array.
Global structure pointers receive their initial values when you compile the source code.
Local and sublocal structure pointers receive their initial values each time the
procedure or subprocedure is activated.
Examples of Structure Pointer Declarations
1. This example uses the $OFFSET standard function to include the address of a
structure field in the expression of a global initialization:
STRUCT t (*); !Template structure
BEGIN
INT k;
END;
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 the automatic extended
data segment
Extended INT ** 32-bit byte address of any structure item located in
any segment, normally 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.