Chapter 13 Device Logic (Pawn)
13.4.5.4 Bit manipulation
Operator Example
Explanation
~
~e
The result is the one's complement of e.
>>
e1 >> e2 The result of the arithmetic shift to the right of e1 by e2 bits. The shift is signed: The bit
on the far left is copied to the free bits of the result.
>>>
e1 >>>
e2
The result of the logical shift to the right of e1 by e2 bits. The shift is unsigned. The free
bits of the result are filled with 0.
<<
e1 << e2 Result: Shift to the left of e1 by e2 bits. The free bits of the result are filled with 0. There
is no difference between an arithmetic and a logical shift to the left.
&
e1 & e2
The result is the bitwise logical "and" of e1 and e2.
|
e1 | e2
The result is the bitwise logical "or" of e1 and e2.
^
e1 ^ e2
The result is the bitwise logical "exclusive or" of e1 and e2.
13.4.5.5 Assignment
The result of an assignment expression is the value of the operand following the assignment.
Operator Example
Explanation
=
v = e
Assigns the value of e to the variable v
v = a
Assigns the array a to variable v. v must be an array of the same size and with the
same dimensions as a. a can be a character string or an array.
Note:
The following operators combine an assignment with an arithmetic or bitwise operation. The
result of the expression is the value of the left operand following the arithmetic or bitwise operation.
Operator Example
Explanation
+=
v += e
Increases v by e
-=
v -= e
Decreases v by e
*=
v *= e
Multiplies v with e
/=
v /= e
Divides v by e
%=
v %= e
Assigns v the remainder of the division of v and e
>>=
v >>= e
Arithmetically shifts v to the right by e bits
>>>=
v >>>= e Logically shifts v to the right by e bits
<<=
v <<= e
Shifts v to the left by e bits
&=
v &= e
Executes a bitwise "and" from v and e and assigns the result to v
|=
v |= e
Executes a bitwise "or" from v and e and assigns the result to v
^=
v ^= e
Executes a bitwise "exclusive or" from v and e and assigns the result to v
Rev. 05
219
Summary of Contents for myDatalogEASY V3
Page 2: ......
Page 13: ...Chapter 2 Declaration of conformity Chapter 2 Declaration of conformity Rev 05 13 ...
Page 14: ......
Page 42: ......
Page 76: ......
Page 88: ......
Page 102: ......
Page 110: ......
Page 116: ......
Page 234: ......
Page 244: ......
Page 252: ......
Page 254: ......
Page 266: ......
Page 276: ......