Skip navigation

ARM Instruction SUB

Subtract

SUB

Thumb syntax (narrow, v4T)

SUBSP, SP, #0508See [1]
SUBRd, SP, #0See [2]
SUBRd, PC, #0See [2]
SUBSRd, Rn, RmSee [3]
SUBSRd, #0255See [2]
SUBSRd, Rn, #07See [4]

Thumb syntax (wide, v6T2)

SUBRd, Rn, #04095
SUBRd, Rn, #constSee [5]
SUBRd, Rn, Rm, shiftSee [6]
SUBSRd, Rn, #constSee [5]
SUBSRd, Rn, Rm, shiftSee [6]

Arm syntax (v4T)

SUBRd, Rn, #constSee [7]
SUBRd, Rn, Rm, shiftSee [8]
SUBRd, SP, Rm, shiftSee [9]
SUBSRd, Rn, #constSee [7]
SUBSRd, Rn, Rm, shiftSee [8]
SUBSRd, SP, Rm, shiftSee [9]

Notes

  1. offset a multiple of 4
  2. Rd must be R0…R7
  3. Rd, Rn, Rm must be R0…R7
  4. Rd, Rn must be R0…R7
  5. RdPC; const is one of $00xx00xx, $xx00xx00, $xxxxxxxx, $xx LSL 024
  6. Rd, RmPC; RmSP; shift is one of LSL #031, LSR #132, ASR #132, RRX
  7. const is $xx ROR 2n
  8. Rd, Rn, RmPC; Rd, RmSP; shift is one of LSL #031/Rs, LSR #132/Rs, ASR #132/Rs, ROR #131/Rs, RRX
  9. Rd, RmPC; RmSP; shift is one of LSL #031/Rs, LSR #132/Rs, ASR #132/Rs, ROR #131/Rs, RRX