pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
index
is an INT constant that specifies an element offset from previous-identifier, which must
be a direct variable. The data type of previous-identifier dictates the element size.
The location represented by index must begin on a word boundary.
+, -
is the word or byte offset, relative to the base of previous-ident, where the equivalenced
variable is placed. For example, if a and b are declared:
INT(32) a[0:9];
INT b = a+6
then b is placed in the first six bits of a.
offset
is an INT constant that specifies an element offset from previous-identifier, which must
be a direct variable. The data type of previous-identifier dictates the element size.
The location represented by index must begin on a word boundary.
Equivalencing a simple variable to an indirect array or structure is not recommended. If you do
so, the simple variable is made equivalent to the location of the implicit pointer, not the location
of the data pointed to.
In Figure 9 (page 183), a STRING variable and an INT(32) variable are equivalenced to an INT
array.
Figure 9 Equivalenced Simple Variables
INT w[0:1];
STRING b = w[0];
INT(32) d = b;
Equivalenced Simple Pointers
An equivalenced simple pointer declaration associates a new simple pointer with a previously
declared variable.
Declaring Nonstructure Equivalenced Variables 183