pTAL Reference Manual (H06.08+)

Structures
HP pTAL Reference Manual523746-006
9-33
VOLATILE Attribute
VOLATILE Attribute
The VOLATILE attribute 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.
You can specify the VOLATILE attribute on any field except a substructure.
The syntax and semantics of VOLATILE fields and VOLATILE pointer fields is the
same as those of VOLATILE variables and pointers, respectively.
Declaring Definition Structures
.
.EXT
.SG
.SGX
are indirection symbols (see Table 2-7 on page 2-7).
identifier
is the identifier of the new referral structure.
Example 9-28. VOLATILE Attribute
STRUCT s;
BEGIN
VOLATILE INT a; ! A simple VOLATILE field
VOLATILE INT .EXT b; ! A VOLATILE extended pointer
VOLATILE INT .c REFALIGNED(2); ! A VOLATILE standard pointer
END; ! with a REFALIGNED clause
STRUCT
identifier
.
.EXT
.SG
.SGX
range field-alignment
structure-layout
;
VST624.vsd