pTAL Conversion Guide

Data Allocation
pTAL Conversion Guide527302-002
5-7
Valid Uses of the VOLATILE Attribute
Topics:
Valid Uses of the VOLATILE Attribute on page 5-7
Invalid Uses of the VOLATILE Attribute on page 5-10
Undefined Uses of the VOLATILE Attribute on page 5-11
Difference Between Volatile Data and Atomic Operations on page 5-11
Valid Uses of the VOLATILE Attribute
You can specify VOLATILE when you declare a:
Simple variable
Pointer
Field in a structure or substructure
Parameter
Topics:
Volatile Simple Variables on page 5-8
Volatile Simple Pointers on page 5-8
Volatile Structure Pointers on page 5-9
Volatile Parameters on page 5-9
Example 5-3. Valid Uses of the VOLATILE Attribute
VOLATILE INT i; ! Simple variable
VOLATILE INT .p; ! Simple pointer
VOLATILE INT .s(s_t); ! Structure pointer
VOLATILE INT .EXT q; ! Extended pointer
VOLATILE INT .SG r; ! Pointer in system globals
VOLATILE INT .SGX s; ! Pointer in system globals
STRUCT s;
BEGIN
VOLATILE INT i; ! Scalar field
VOLATILE INT .j; ! Pointer field
END;
PROC p(s, l);
VOLATILE INT .s; ! Reference parameter
VOLATILE INT l; ! Value parameter
BEGIN
...
END;