pTAL Conversion Guide

pTAL Built-In Routines
pTAL Conversion Guide527302-002
18-12
$ATOMIC_DEP
$ATOMIC_DEP
$ATOMIC_DEP, an atomic operation, 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)
Sets condition code Yes (according the final value of var )
Sets $CARRY No
Sets $OVERFLOW No
Example 18-4. Call to $ATOMIC_DEP Routine
INT var;
INT mask;
INT value;
$ATOMIC_DEP(var, mask, value);
,
) ;
VST609.vsd
($ATOMIC_DEP ,var
mask
value