The assembler order of precedence is not exactly the same as in C.
(1 + 2 :SHR: 3) evaluates
(1 + (2 :SHR: 3)) = 1 in
The equivalent expression in C evaluates as
((1 + 2) >>
3) = 0.
ARM recommends you use brackets to make the precedence explicit.
If your code contains an expression that would parse differently
in C, and you are not using the
gives a warning:
A1466W: Operator precedence means that expression would evaluate differently in C
From these tables:
The highest precedence operators are at the top of the list.
The highest precedence operators are evaluated first.
Operators of equal precedence are evaluated from left to right.
|armasm precedence||equivalent C operators|
|unary operators||unary operators|