22.11.12 Operator
22.11.12.1 Addition (+)
Adds the data in two word addresses, or the data in a word address
and a constant.
22.11.12.2 Subtraction (-)
Subtracts the data between two word addresses, or the data in a
word address and a constant.
22.11.12.3 Modulus (%)
Returns the remainder from a division operation on two word
addresses, or a word address and constant.
22.11.12.4 Multiplication (*)
Multiplies the data in two word addresses, or the data in a word
address and a constant.
22.11.12.5 Division (/)
Divides the data in two word addresses, or the data in a word
address and a constant.
22.11.12.6 Assignment (=)
Assign the value on the right hand side to the left hand side.
22.11.12.7 Shift Left
(<<)
Shifts the data on the left side to the left by the number on the
right side.
22.11.12.8 Shift Right
(>>)
Shifts the data on the left side to the right by the number on the
right side.
22.11.12.9 Bit Operator Logical
AND (&)
Performs logical AND of data between word devices, or between word
device data and constant.
22.11.12.10 Bit Operator Logical
OR (|)
Performs logical OR of data between word devices, or between word
device data and constant.
22.11.12.11 Bit Operator Exclusive OR
(^)
Performs exclusive OR of data between word devices, or between word
device data and constant.
22.11.12.12 Bit Operator 1's
Complement (~)
Inverts the bits.
Order of Precedence and Associativity
The following table shows the order of precedence of operators.
If two or more operators have the same order of precedence, follow
the direction shown by the associativity.
Priority
|
Operator
|
Associativity
|
High
|
( )
|
→
|
|
not ~
|
←
|
|
* / %
|
→
|
|
+ -
|
→
|
|
<< >>
|
→
|
|
< <= > >=
|
→
|
|
== <>
|
→
|
|
& ^ |
|
→
|
|
and or
|
→
|
Low
|
=
|
←
|
|