You copied the Doc URL to your clipboard.

CMP (immediate)

Compare (immediate), setting the condition flags and discarding the result.

This instruction is an alias of SUBS (immediate).

Syntax

CMP  Wn|WSP, #imm{, shift}    ; 32-bit general registers

Equivalent to SUBS WZR, Wn|WSP, #imm {, shift}

CMP  Xn|SP, #imm{, shift}    ; 64-bit general registers

Equivalent to SUBS XZR, Xn|SP, #imm {, shift}

Where:

Wn|WSP

Is the 32-bit name of the source general-purpose register or stack pointer, in the range 0 to 31.

Xn|SP

Is the 64-bit name of the source general-purpose register or stack pointer, in the range 0 to 31.

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.

Was this page helpful? Yes No