TAL Programmer's Guide
Accessing the Upper 32K-Word Area
Managing Addressing
B–8 096254 Tandem Computers Incorporated
Indexing the Upper
32K-Word Boundary
Although an index for standard indirect structures must fall within the signed INT
range, a word offset (from the zeroth structure occurrence) can be in the range –65,535
through 65,535. The following example shows how you can access such offsets:
STRUCT x (
*
);
 BEGIN
 INT i, j;
 END;
PROC m MAIN;
 BEGIN
 INT .y (x) := %70000; !Y[0:18430] spans the
 ! 32K-word boundary
 USE i;
 FOR i := 0 TO 18430 DO
 y[i].i := y[i].j := 0;
 DROP i;
 END;
Note If you use an array of structure occurrences that spans the 32K-word boundary, your program must
handle the data stack overflow condition. The compiler issues an error only when the data stack
overflows the 32K-word boundary.
A byte offset, as opposed to a word offset, can be in the range –65,535 through 65,535 if
the structure occurrences are either all in the lower 32K words or all in the upper 32K
words of the user data segment. Otherwise, the byte offset is incorrect.
If the structure is in the upper 32K words of the user data segment, you must use
$XADR and extended (32-bit) addressing. Here is an example:
STRUCT x (
*
);
 BEGIN
 STRING s[0:1];
 END;
PROC m MAIN:
 BEGIN
 INT .y (x) := %100000; !Y[0:32767} is in the
 ! upper 32K-word area
 INT .EXT z (x) := $XADR (y);
 INT i;
 FOR i := 0 TO 32767 DO
 z.s[1] := z.s[0] := 0;
 END;










