Operator precedence
Operator precedence has 32-bit expressions.
Operator precedence for 32-bit expressions is shown in the following figure.
Highest Priority
| ( )
| unary -, unary +, ~
| * / < >
| | ^ &
| + _
V
Lowest PriorityIn 32-bit mode, all the operators perform 32-bit signed integer operations. In 64-bit mode, all computations are performed using 64-bit signed integer operations.
The division operator produces an integer result; the remainder has the same sign as the dividend. For example:
Operation | Result | Remainder |
---|---|---|
8/3 | 2 | 2 |
8/-3 | -2 | 2 |
(-8)/3 | -2 | -2 |
(-8)/(-3) | 2 | -2 |
The left shift (<) and right shift (>) operators take an
integer bit value for the right-hand operand. For example:
.set mydata,1
.set newdata,mydata<2
# Shifts 1 left 2 bits.
# Assigns the result to newdata.