TAL Programmer's Guide

Equivalencing Simple Variables
Using Equivalenced Variables
096254 Tandem Computers Incorporated 10–5
Accessing Equivalenced
Simple Variables
Once you have declared an equivalenced variable, you access it in the same way as
you access any other variable, by specifying its identifier in a statement.
Accessing Words in Doublewords
You can declare two INT variables, each equivalent to one of the two words of an
INT(32) variable. You can then access the location either as an INT variable or as an
INT(32) variable:
A
B
304
INT(32) dbl;
INT a = dbl;
INT b = a[1];
a := 0; !Access first word of DBL
dbl := -1D; !Access DBL as a doubleword
DBL
Accessing Bytes in Words
You can equivalence a STRING variable to an INT array, and then access bytes in the
INT array by indexing the STRING variable:
INT word[0:2];
STRING s = word;
s[3] := 0;
IF s[4] > 2 THEN ...;
305
WORD[0]
WORD[1]
WORD[2]
S[0] S[1]
S[2] S[3]
S[4] S[5]