pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
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
is any data type except UNSIGNED. The data type determines how much data the simple
pointer can access at a time (byte, word, doubleword, or quadrupleword).
Indirection
., .EXT, .EXT32, .EXT64, .SG, and .SGX are indirection symbols (see Table 14 (page 41)).
NOTE: Indirection symbols, .EXT32 and .EXT64 are available in the 64-bit addressing
functionality added to the EpTAL compiler starting with SPR T0561H01^AAP. For more
information, see Appendix E, “64-bit Addressing Functionality” (page 531).
identifier
is the identifier of a simple pointer to be made equivalent to previous-identifier.
previous-identifier
is the identifier of a previously-declared variable, direct array element, pointer, structure,
structure pointer, or equivalenced 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.
Topics:
• Using Equivalenced Simple Pointers (page 184)
• REFALIGNED Clause for Equivalenced Simple Pointers (page 187)
Using Equivalenced Simple Pointers
If the previous variable is a pointer, an indirect array, or an indirect structure, the previous pointer
and the new pointer must both contain either:
• A standard byte address
• A standard word address
• An extended address
Otherwise, the pointers will point to different locations, even if they both contain the same value.
That is, a standard STRING or extended pointer normally points to a byte address, and a standard
pointer of any other data type normally points to a word address.
184 Equivalenced Variables