TAL Programmer's Guide
Declaring Definition Structures
Using Structures
8–6 096254 Tandem Computers Incorporated
Addressability
of Structures
The zeroth occurrence of a structure must be addressable. If it is not addressable, the
compiler issues an address range violation error. (In the following diagrams,
parentheses enclose the zeroth occurrence to indicate that it is not addressable.)
Addressability in the User Data Segment
The zeroth occurrence of a direct structure must fit within the lower 32K-word area of
the user data segment, even if the zeroth occurrence is not allocated.
The global area has G-plus addressing. If a global structure is located at G[0], its lower
bound must be a 0 or negative value. Avoid the following practice:
G[0]
G[1]
ASTR[1]
ASTR[2]
382
( ASTR[0] )
STRUCT astr[1:2];
BEGIN
INT x;
END;
The sublocal area has S-minus addressing. If a sublocal structure is located at S[0], its
upper bound must be a 0 or larger value. Avoid the following practice:
383
S[-2]
S[-1]
S[0]
BSTR[-3]
BSTR[-1]
BSTR[-2]
( BSTR[0] )
SUBPROC s;
BEGIN
STRUCT bstr[-3:-1];
BEGIN
INT x;
END;
END;
Addressability in the Extended Segment
The zeroth occurrence of an extended indirect structure must reside within the
extended data segment, even if the zeroth occurrence is not allocated. If an extended
indirect structure is located at the beginning of the extended data segment, the lower
bound must be a 0 or negative value. Avoid the following practice:
384
%2000000
User data segment
G[0]
ptr to XSTR
Automatic extended
data segment
XSTR[1]
XSTR[2]
( XSTR[0] )
STRUCT .EXT xstr[1:2];
BEGIN
INT x;
END;