You copied the Doc URL to your clipboard.
SUBS (immediate)
Subtract (immediate), setting flags.
This instruction is used by the alias CMP
(immediate).
Syntax
SUBS
Wd
, Wn|WSP
, #imm
{, shift
} ; 32-bit
SUBS
Xd
, Xn|SP
, #imm
{, shift
} ; 64-bit
Where:
Wd
- Is the 32-bit name of the general-purpose destination register.
Wn|WSP
- Is the 32-bit name of the source general-purpose register or stack pointer.
Xd
- Is the 64-bit name of the general-purpose destination register.
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 eitherLSL #0
orLSL #12
.
Operation
Subtract (immediate), setting flags, subtracts an optionally-shifted immediate value from a register value, and writes the result to the destination register. It updates the condition flags based on the result.
, where R
d = R
n - shift
(imm)
is either R
W
or X
.