Ax51 User's Guide

Operators

Operators may be unary (requiring one operand) or binary (requiring two operands). The combination of an operator and its operand(s) is an expression. Parentheses may be used in expressions with multiple operators to specify the order in which operators are evaluated. If no parentheses are used in an expression, operator precedence determines the evaluation order.

Following is the operator precedence table:

LevelOperators
1( )
2NOT HIGH LOW
BYTE0 BYTE1 BYTE2 BYTE3
WORD0 WORD2
MBYTE
3Unary + Unary -
4* / MOD
5+ -
6SHL SHR
7AND OR XOR
8EQ = NE <> LT < LTE <= GT > GTE >=

The Ax51 Assembler also supports the following C compatible operators. The C operators are identical with the corresponding Assembler operator are listed in the following table:

C OperatorIdentical Ax51 Operator
&AND
|OR
^
XOR
<<SHL
>>SHR
!=NE <>