SAM3X8E Atmel Corporation, SAM3X8E Datasheet - Page 118

no-image

SAM3X8E

Manufacturer Part Number
SAM3X8E
Description
Manufacturer
Atmel Corporation
Datasheets
11.13.5
11.13.5.1
11.13.5.2
11.13.5.3
11.13.5.4
11.13.5.5
118
118
CMP
CMN
CMPGT
SAM3X/A
SAM3X/A
CMP and CMN
Syntax
Operation
Restrictions
Condition flags
Examples
R2, R9
R0, #6400
SP, R7, LSL #2
Compare and Compare Negative.
where:
cond
Rn
Operand2
details of the options.
These instructions compare the value in a register with Operand2. They update the condition
flags on the result, but do not write the result to a register.
The CMP instruction subtracts the value of Operand2 from the value in Rn. This is the same as
a SUBS instruction, except that the result is discarded.
The CMN instruction adds the value of Operand2 to the value in Rn. This is the same as an
ADDS instruction, except that the result is discarded.
In these instructions:
These instructions update the N, Z, C and V flags according to the result.
• do not use PC
• Operand2 must not be SP.
CMP{cond} Rn, Operand2
CMN{cond} Rn, Operand2
is an optional condition code, see
is the register holding the first operand.
is a flexible second operand. See
“Conditional execution” on page
“Flexible second operand” on page 91
11057A–ATARM–17-Feb-12
11057A–ATARM–17-Feb-12
96.
for

Related parts for SAM3X8E