TAL Programmer's Guide
Declaring Arrays
Using Arrays
096254 Tandem Computers Incorporated 7–11
Addressability of Arrays The zeroth element of an array must always be addressable. If it is not addressable,
the compiler issues an address range violation error.
Addressability in the User Data Segment
The zeroth element of a direct array must fit within the lower 32K-word area of the
user data segment, even if the zeroth element is not allocated.
The global area has G-plus addressing. If a global array is located at G[0], its lower
bound must be a zero or negative value. Avoid the following practice:
G[0]
G[1]
A[1]
A[2]
372
( A[0] )
INT a[1:2];
The sublocal area has S-minus addressing. If a sublocal array is located at S[0], its
upper bound must be a zero or larger value. Avoid the following practice:
S[-2]
S[-1]
S[0]
A[-3]
A[-1]
A[-2]
373
SUBPROC s;
BEGIN
!Sublocal data
INT a[-3:-1];
!Lots of code
END;
( A[0] )
Addressability in the Extended Segment
The zeroth element of an extended indirect array must reside within the automatic
extended data segment, even if the zeroth element is not allocated. If an extended
indirect array is located at the beginning of the extended data segment, its lower
bound must be a zero or negative value. Avoid the following practice:
INT .EXT aa[1:2];
Automatic extended
data segment
User data segment
G[0]
ptr to AA
374
AA[1]
AA[2]
( AA[0] )