pTAL Reference Manual (H06.08+)

Equivalenced Variables
HP pTAL Reference Manual523746-006
11-9
Equivalenced Simple Variables
VOLATILE
specifies that the value of this variable must be maintained in memory, not in a
register. Each reference to a VOLATILE data item causes the data item to be read
or written to memory even when code is optimized. Based on the order of reads
and writes in the source code, VOLATILE also causes that precise order of
memory references to be preserved, again, when code is optimized.
type
If referral is present, type must be STRING or INT; otherwise, type is any
data type except UNSIGNED.
identifier
is the identifier of the simple equivalenced variable to be made equivalent to
previous-identifier.
previous-identifier
is the identifier of a previously declared simple variable.
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 11-2 on page 11-10, a STRING variable and an INT(32) variable are
equivalenced to an INT array.