TAL Programmer's Guide
Equivalencing Structures
Using Equivalenced Variables
096254 Tandem Computers Incorporated 10–13
Equivalencing Structures to Structure Pointers
If you equivalence an indirect structure to a structure pointer, the indirect structure
behaves exactly like the structure pointer:
ptr to STR1
PTR
STRUCT .str1;
 BEGIN
 INT a[0:3];
 INT b[0:9];
 END;
INT .ptr (str1) := @str1; 
STRUCT .str2 = ptr;
 BEGIN
 STRING a2[0:7];
 STRING b2[0:19];
 END;
ptr to STR2
STR2STR1
317
Secondary area
.
.
.
.
.
.
.
.
.
Avoid Mixing Addressing Modes
Do not equivalence an indirect structure to a direct variable, because the implicit
pointer to the indirect structure cannot point to the structure data. Avoid the
following practice:
319
STRUCT dir_str; 
 BEGIN 
 STRING a[0:19];
 STRING b[0:49];
 END;
STRUCT .ind_str = dir_str; 
 BEGIN 
 INT a[0:9];
 INT b[0:24];
 END;
DIR_STR
ptr to IND_STR
IND_STR
.
.
.
Primary area
Secondary area
.
.
.










