TAL Programmer's Guide

Declaring Arrays
Using Arrays
7–2 096254 Tandem Computers Incorporated
Using Indirection The global primary storage area is limited to 256 words and the local primary area is
limited to 127 words. The global and local secondary areas have no explicit size, and
the total of all primary and secondary areas can be as large as the lower 32K-word area
of the user data segment. You can minimize the impact on the primary areas by
declaring indirect global and local arrays. Global and local arrays of any data type
except UNSIGNED can be indirectly addressed.
The sublocal storage area has no secondary area, so all sublocal arrays must be directly
addressed.
To declare a standard indirect array, precede the array identifier with a standard
indirection symbol (.) as follows:
INT .array_x[0:1]; !Declare standard indirect array
To declare an extended indirect array, precede the array identifier with an extended
indirection symbol (.EXT) as follows:
INT .EXT array_y[0:1]; !Declare extended indirect array
Specifying Data Types The data type determines the kind of values the array can contain. The data type also
determines the storage unit the compiler allocates for each array element, as follows:
Data Type Storage Unit
STRING Byte
INT Word
INT(32) or REAL Doubleword
REAL(64) or FIXED Quadrupleword
UNSIGNED Sequence of 1, 2, 4, or 8 bits
“Arrays by Data Type” in this section gives more information on each data type.
Initializing Arrays You can initialize most arrays when you declare them. You cannot initialize
UNSIGNED or local extended indirect arrays. It is recommended that you initialize
arrays with values that are appropriate for the data type of the array.
To initialize an array, include an assignment operator (:=) and a constant list or a
constant in the array declaration. For example, you can initialize an array with a
constant list as follows:
INT array[0:1] := ["A", "B"];
More information on array initializations is given in the following subsections.