The assembler uses 32-bit signed arithmetic to evaluates expressions; it does not check for arithmetic overflow.
As different processors use different operators, the assembler uses an expression syntax similar to that of the C language. Expressions use C operators and follow C rules for parentheses and associativity.
The following table lists the expression operators that the assembler supports.
| Category | Operator | Description |
|---|---|---|
| Binary | + | add |
| - | subtract | |
| * | multiply | |
| / | divide | |
| % | modulo | |
| || | logical OR | |
| && | logical AND | |
| | | bitwise OR | |
| & | bitwise AND | |
| ^ | bitwise XOR | |
| << | shift left | |
| >> | shift right (zeros are shifted into high order bits) | |
| == | equal to | |
| != | not equal to | |
| Binary | <= | less than or equal to |
| >= | greater than or equal to | |
| < | less than | |
| > | greater than | |
| Unary | + | unary plus |
| - | unary minus | |
| ~ | unary bitwise complement | |
| Alternate | <> | not equal to |
Operator precedence is:
Gnu- or ADS-compatibility modes change some of these operator precedences.