sub

Subtract (A32)

SUB{S}<c> <Rd>, <Rn>, <Operand2>

Subtracts two values.

Details

The Subtract instruction subtracts two values.

Pseudocode Operation

Rd ← Rn - Operand2
// Flags affected: N, Z, C, V

Example

SUB r0, r1, r2

Encoding

Binary Layout
cond
00
1
0010
S
Rn
Rd
imm12
 
Format Data Proc
Opcode 0x02400000
Extension A32 (Base)

Operands

  • Rd
    Destination general-purpose register
  • Rn
    First source / base general-purpose register
  • Operand2
    Flexible second operand (register or shifted register)