pTAL Reference Manual (G06.24+, H06.09+, J06.03+)
Do not use STRUCT(MAXALIGN) within a SHARED2 structure.
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.
Example 79 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
Declaring Definition Structures
., Indirection
., .EXT, .EXT32, .EXT64, .SG, and .SGX are indirection symbols (see Table 14 (page 41)).
identifier
is the identifier of the new referral structure.
range
lower-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth structure occurrence) of the first structure occurrence you want
to allocate. Each occurrence is one copy of the structure.
upper-bound
is an INT constant expression (in the range -32,768 through 32,767) that specifies the
index (relative to the zeroth structure occurrence) of the last structure occurrence you want
to allocate. For a single-occurrence structure, omit both bounds or specify the same value
for both bounds.
138 Structures