Chapter 8 Writing Source Statements
138 Expressions
8.7.1 Operators
There are three types of operators.
Arithmetic operators
Shift operators
Logical operators

Arithmetic operators

Arithmetic operators perform the four standard arithmetic calculations.
Formats: Example:
operand1 * operand2 123 * LABEL
operand1 / operand2 123 / 10
operand1 % operand2 COUNT % 4
operand1 + operand2 SATRT + 0x10
operand1 operand2 STACK – 16
+ operand +SIGN
~operand -SIGN

Shift operators

The shift operators shift to the left or right in bit units.
Formats:
operand>>countADDRESS >> 3 3-bit right shift
operand<<countADDRESS << 4 4-bit left shift
Binary 0 (zero) will be shifted in. Shifted out bits will be lost.
Operator Meaning
* Multiplication
/ Division
% Modulo operator (remainder)
+ Addition
- Subtraction
+ Unary plus (positive)
~ Unary minus (negative)
Operator Meaning
>> Logical right shift
<< Logical left shift