Unary Operators | |||
---|---|---|---|
Operator | Meaning | Example | Value left in r0 |
- | negate | movl #-1, r0 | -1 |
~ | bit negate | movl #~0xFFFFFFFE, r0 | 0x1 |
Binary Operators | |||
Operator | Meaning | Example | Value left in r0 |
& | bitwise and | movl #0xFFFF & 07, r0 | 7 |
| | bitwise or | movl #01 | 05, r0 | 5 |
^ | bitwise exclusive or | movl #07 ^ 05, r0 | 2 |
! | operand1 | ~operand2 | movl #01 ! 05, r0 | 0xFFFFFFFB |
* | multiplication | movl #12 * 7, r0 | 84 |
/ | integer division | movl #75 / 6, r0 | 12 |
% | modulo | movl #75 % 6, r0 | 3 |
+ | addition | movl #7 + 4, r0 | 11 |
- | subtraction | movl #7 - 4, r0 | 3 |
>> | logical right shift | movl #8 >> 2, r0 | 2 |
<< | logical left shift | movl #1 << 4, r0 | 16 |