pTAL Reference Manual (G06.24+, H06.09+, J06.03+)

value
input
INT:value
holds the bits that, after being masked, $ATOMIC_DEP deposits in var.
$ATOMIC_DEP performs the following operation:
var := (var LAND $COMP(mask)) LOR (value LAND mask)
All the operations are performed without interruption, as if they were one.
Example 227 $ATOMIC_DEP Routine
INT var;
INT mask;
INT value;
$ATOMIC_DEP(var, mask, value);
The following table shows examples of $ATOMIC_DEP:
resultmaskvaluevar
%H0220%HAAAA%H1234%H0000
%H1010%H5555%H1234%H0000
%H2288%HAAAA%H6789%H0000
%H1010%H5555%H6789%H0000
$ATOMIC_GET
$ATOMIC_GET atomically gets (returns) the value of a variable.
YesSets condition code
NoSets $CARRY
NoSets $OVERFLOW
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.
Atomic Operations 279