pTAL Reference Manual (H06.08+)
Built-In Routines
HP pTAL Reference Manual—523746-006
15-8
$ATOMIC_GET
The following table shows examples of $ATOMIC_DEP:
$ATOMIC_GET
$ATOMIC_GET atomically gets (returns) the value of a variable.
var input
type:variable
is the variable whose value $ATOMIC_GET returns. var must be one of:
•
A well-aligned byte, 2-byte, or 4-byte variable whose address is an integral
multiple of its width.
•
A bit field fully contained in a 1-byte, 2-byte, or 4-byte variable that is
aligned on an even-byte boundary.
If var is not well aligned, an error occurs.
The operation is performed without interruption.
var value mask result
%H0000 %H1234 %HAAAA %H0220
%H0000 %H1234 %H5555 %H1010
%H0000 %H6789 %HAAAA %H2288
%H0000 %H6789 %H5555 %H1010
Sets condition code Yes
Sets $CARRY No
Sets $OVERFLOW No
Example 15-6. $ATOMIC_GET Routine
INT var1;
INT var2;
var1 := $ATOMIC_GET(var2);
if < then ... ! OK: $ATOMIC_GET sets condition code
$ATOMIC_GET ( ) ;
VST610.vsd
var










