TAL Programmer's Guide
Accessing Structure Items
Using Structures
8–32 096254 Tandem Computers Incorporated
D-Series System. If you are writing a program to run on a D-series system and need to
index into extended indirect structures, you can either:
Determine when to use a signed INT or INT(32) index as described for C-series
programs in the preceding subsection.
Use the INT32INDEX directive, which is easier and safer, albeit slightly less
efficient.
INT32INDEX generates INT(32) indexes from INT indexes and computes the correct
offset for the indexed structure item. INT32INDEX overrides the INHIBITXX or
NOINHIBITXX directive, whichever is in effect.
NOINT32INDEX, the default, generates incorrect offsets for structure items whose
offsets are outside the signed INT range. NOINT32INDEX does not override
INHIBITXX or NOINHIBITXX.
Specify INT32INDEX or NOINT32INDEX immediately before the declarations to
which it applies. The specified directive then applies to those declarations throughout
the compilation. The following D-series example shows how INT32INDEX generates
correct offsets and NOINT32INDEX generates incorrect offsets:
?INT32INDEX !Assign INT32INDEX attribute
! to subsequent declaration
STRUCT .EXT xstruct[0:9999];
BEGIN !XSTRUCT has INT32INDEX
STRING array[0:9]; ! attribute
END;
INT index;
PROC my_proc MAIN;
BEGIN
?NOINT32INDEX !Assign NOINT32INDEX attribute to
! subsequent declaration
STRUCT .EXT xstruct2 (xstruct) := @xstruct[0];
!XSTRUCT2 has NOINT32INDEX
! attribute
xstruct[index].array[0]:= 1;
!Generate correct offset even
! when offset is greater than
! 32,767, because XSTRUCT
! has INT32INDEX attribute
xstruct2[index].array[0] := 1;
!Generate incorrect offset if
! offset is greater than 32,767,
! because XSTRUCT2 has
END; ! NOINT32INDEX attribute