TAL Reference Manual

Pointers
TAL Reference Manual526371-001
9-4
Examples of Simple Pointer Declarations
The following table shows the kinds of global variables to which you can apply the @
operator:
When Pointers Receive Initial Values
Global simple pointers receive their initial values when you compile the source code.
Local or sublocal simple pointers receive their initial values at each activation of the
encompassing procedure or subprocedure.
Examples of Simple Pointer Declarations
1. This example declares but does not initialize a simple pointer:
INT(32) .ptr; !Declare simple pointer
2. This example declares a simple pointer and initializes it with the address of the last
element in an indirect array:
STRING .bytes[0:3]; !Declare indirect array
STRING .s_ptr := @bytes[3]; !Declare simple pointer
!initialized with address
!of BYTES[3]
@identifier ‘ >>’1 Converts byte address to word address
@identifier[index] Accesses address of variable indicated by index
Standard function Any that return a constant value, such as $OFFSET
Variable @identifier?
Direct array Yes
Standard indirect array Yes
Extended indirect array No
Direct structure Yes
Standard indirect structure Yes
Extended indirect structure No
Simple pointer No
Structure pointer No
Expression Meaning