pTAL Reference Manual (H06.08+)

Built-In Routines
HP pTAL Reference Manual523746-006
15-7
$ATOMIC_DEP
$ATOMIC_DEP
$ATOMIC_DEP atomically deposits bits into an INT variable.
var input,output
INT:variable
is the variable into which $ATOMIC_DEP deposits bits from value.
mask input
INT:value
is a 16-bit mask word that determines which bits of value to deposit into var.
$ATOMIC_DEP stores into each bit position of var. The corresponding bit in
value after performing an and operation between the corresponding bits in
value and mask.
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.
Sets condition code Yes (according the final value of var )
Sets $CARRY No
Sets $OVERFLOW No
Example 15-5. $ATOMIC_DEP Routine
INT var;
INT mask;
INT value;
$ATOMIC_DEP(var, mask, value);
,
) ;
VST609.vsd
($ATOMIC_DEP ,
var
mask
value