Summary of assembler operators
The following tables give a summary of the operators, in order of precedence. Synonyms, where available, are shown after the operator name.
Note
The operator synonyms are enabled by the option -j. See also the chapter Migrating to the IAR Assembler for Arm.
Parenthesis operator
Precedence: 1
| Parenthesis. |
Unary operators
Precedence: 1
| Unary plus |
| Unary minus |
| Logical NOT |
| Bitwise NOT |
| Low byte |
| High byte |
| First byte |
| Second byte |
| Third byte |
| Fourth byte |
| Lower 12 bits of a symbol |
| Low word |
| High word |
| Current time/date |
| The offset to a symbol from the addressing origin of its output segment. |
| Section begin |
| Section end |
| Section size |
Multiplicative arithmetic operators
Precedence: 2
| Multiplication |
| Division |
| Modulo |
Additive arithmetic operators
Precedence: 3
| Addition |
| Subtraction |
Shift operators
Precedence: 2.5-4
| Logical shift right (4) |
:SHR: | Logical shift right (2.5) |
| Logical shift left (4) |
:SHL: | Logical shift left (2.5) |
AND operators
Precedence: 3-8
| Logical AND (5) |
:LAND: | Logical AND (8) |
| Bitwise AND (5) |
:AND: | Bitwise AND (3) |
OR operators
Precedence: 3-8
| Logical OR (6) |
| Bitwise OR (6) |
:OR: | Bitwise OR (3) |
| Logical exclusive OR (6) |
:LEOR: | Logical exclusive OR (8) |
| Bitwise exclusive OR (6) |
:EOR: | Bitwise exclusive OR (3) |
Comparison operators
Precedence: 7
| Equal to |
| Not equal to |
| Greater than |
| Less than |
| Unsigned greater than |
| Unsigned less than |
| Greater than or equal to |
| Less than or equal to |