Arm/invert

From ASMBits

Write a function that returns the bitwise inversion of its parameter.

int invert (int n);

Expected solution length: Around 2 lines.

Sample Input

1

Sample Output

0xfffffffe

ARM has an instruction for inversion, but it is oddly named: "move inverse".

Write your solution here

x
 
1
.global _start
2
_start:
3
    mov r0, #1
4
    bl invert
5
    1: b 1b    // Done
6
7
.global invert
8
invert:
9
    
10
    
Upload a source file...