Manual – IPOSplus®
305
23
Arithmetic commands
Assembler – Commands
XOR
The XOR command performs a bit-by-bit XOR operation between a variable and a sec-
ond variable or a hexadecimal constant.
23.3.4 SHIFT commands SHL/SHR/ASHR
SHIFT commands are used to move the content of a variable bit-by-bit. All variable bits
are given a new significance. The number of places to be shifted is specified in the 2nd
argument.
SHL/SHIFT LEFT
The SHL command moves the content of a variable to the left by the number of bits
specified in a variable or constant. Zeros are moved along from the right.
Command structure
Mxxx XOR X1 XOR X2
Mxxx: Label (optional)
X1: Variable (result and output value)
X2: Variable or constant (output value)
XOR HXX XOR HYY
Variable HXX is the bit-by-bit XOR operation of variables HXX and HYY.
XOR HXX XOR K
Variable HXX is the bit-by-bit XOR operation of variable HXX and a con-
stant K.
Example
SET H01 = 65535XOR H01 XOR
F0F0 hex
[0x00000FFF][0x0000FF0F]
After the XOR command, H01 = 0xFF0F.
Command structure
Mxxx SHL X1 << X2
Mxxx: Label (optional)
X1: Variable (result and output value)
X2: Variable or constant (number of shift operations)
SHL HXX << HYY
In variable HXX the bits are shifted HYY places to the left.
SHL HXX << K
In variable HXX the bits are shifted by K places to the left.
Example 1
SET H01 = 31SET H02 = 1SHL
H01 << H02
[0b0000000000011111][0b000
0000000111110]
After the SHL command, H01 = 62.
Example 2
A certain binary significance is assigned to the output terminals of the
basic unit and the DIO11A option. To use outputs DO10 ... DO13 for table
positioning in a useful manner (4 entries = 0 ... 15 positions), shift the sig-
nificance of the outputs so that the terminal with the lowest value DO10
receives the significance 2
0
.
SET H01 = 15SET H02 = 6SHL
H01 << H02
[0b0000000000001111][0b000
0001111000000]
P
i
f
kVA
Hz
n
P
i
f
kVA
Hz
n