ARM Data Processing Instructions
These instructions alter register values and/or status flags based on the values in registers. There are four types of instruction.
Instruction Types
Type | Example | Format | Flags Changed |
Register Changed |
---|---|---|---|---|
Arithmetic | ADD R1, R2, R3 | ADD dest, op1 , op2 | if S suffix | dest |
Logical | AND R1, R2, R3 | AND dest, op1 , op2 | if S suffix | dest |
Move | MOV R1, R2 | MOV dest, op2 | If S suffix | dest |
Compare | CMP R1, R2 | CMP op1, op2 | Always | None |
Operand Formats
The dest and op1 operands must always be registers. Flexible op2 is also allowed to be a literal number (prefixed by #) or a shifted register. All small and some large literal numbers are allowed.
Op | Example | Format | Notes |
---|---|---|---|
dest | R5 | Rd (d=0-15) | single register |
op1 | R3 | Rn (n=0-15) | single register |
op2 | R1 #101 R1, LSL #1 |
Rm (n=0-15) #N (N = op2 integer) (Shifts) |
Flexible op2 |