16.147 SUB (immediate)

Subtract (immediate).

Syntax

SUB Wd|WSP, Wn|WSP, #imm{, shift} ; 32-bit

SUB Xd|SP, Xn|SP, #imm{, shift} ; 64-bit

Where:

Wd|WSP
Is the 32-bit name of the destination general-purpose register or stack pointer.
Wn|WSP
Is the 32-bit name of the source general-purpose register or stack pointer.
Xd|SP
Is the 64-bit name of the destination general-purpose register or stack pointer.
Xn|SP
Is the 64-bit name of the source general-purpose register or stack pointer.
imm
Is an unsigned immediate, in the range 0 to 4095.
shift
Is the optional left shift to apply to the immediate, defaulting to LSL #0, and can be either LSL #0 or LSL #12.

Operation

Subtract (immediate) subtracts an optionally-shifted immediate value from a register value, and writes the result to the destination register.

Rd = Rn - shift(imm), where R is either W or X.

Non-ConfidentialPDF file icon PDF versionARM 100069_0608_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.