Atmel SAM4S Xplained Pro Starter and Evaluation Kit ATSAM4S-XPRO ATSAM4S-XPRO Fiche De Données
Codes de produits
ATSAM4S-XPRO
123
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
12.6.5.5 CMP and CMN
Compare and Compare Negative.
Syntax
Syntax
CMP{cond} Rn, Operand2
CMN{cond} Rn, Operand2
where:
condis an optional condition code, see
condis an optional condition code, see
.
for details of the
options
Operation
These instructions compare the value in a register with Operand2. They update the condition flags on the result,
Operation
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
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,
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.
Restrictions
Restrictions
In these instructions:
Do not use PC
Operand2
must not be SP.
Condition Flags
These instructions update the N, Z, C and V flags according to the result.
Examples
These instructions update the N, Z, C and V flags according to the result.
Examples
CMP
R2, R9
CMN
R0, #6400
CMPGT
SP, R7, LSL #2