22.11.13 Operator

22.11.13.1 Add (+)
Adds the data in two word addresses, or the data in a word address and a constant.

22.11.13.2 Subtract (-)
Subtracts the data between two word addresses, or the data in a word address and a constant.

22.11.13.3 Modulus (%)
Returns the remainder from a division operation on two word addresses, or a word address and constant.

22.11.13.4 Multiplication (*)
Multiplies the data in two word addresses, or the data in a word address and a constant.

22.11.13.5 Division (/)
Divides the data in two word addresses, or the data in a word address and a constant.

22.11.13.6 Assignment (=)
Assign the value on the right hand side to the left hand side.

22.11.13.7 Shift Left (<<)
Shifts the data on the left side to the left by the number on the right side.

22.11.13.8 Shift Right (>>)
Shifts the data on the left side to the right by the number on the right side.

22.11.13.9 Bit Operator Logical AND (&)
Performs logical AND of data between word devices, or between word device data and constant.

22.11.13.10 Bit Operator Logical OR (|)
Performs logical OR of data between word devices, or between word device data and constant.

22.11.13.11 Bit Operator Exclusive OR (^)
Performs exclusive OR of data between word devices, or between word device data and constant.

22.11.13.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

=