Datasheet

2-40 MCF5407 User’s Manual
ColdFire Instruction Set Architecture Enhancements
CMP Compare CMP
Operation: Destination – Source cc
Assembler Syntax: CMP <ea>y, Dx
Attributes: Size = byte, word, long
Description: Subtracts the source operand from the destination operand in the data register
and sets condition codes according to the result; the data register is unchanged. The
operation size may be a byte, word, or longword.
CMPA is used when the destination is an address register; CMPI is used when the source
is immediate data. Most assemblers automatically make this distinction.
Condition Codes:
Instruction Fields:
Register eld—species the destination register.
Opmode eld:
Effective address eld species the source operand; use addressing modes in the
following table:
X N Z V C X Not affected
N Set if the result is negative; cleared otherwise
Z Set if the result is zero; cleared otherwise
V Set if an overflow occurs; cleared otherwise
C Set if a borrow occurs; cleared otherwise
∗∗∗∗
1514131211109876543210
Instruction
Format:
1011 REGISTER OPMODE EFFECTIVE ADDRESS
MODE REGISTER
Byte Word Long Operation
000 001 010 Dx - <ea>y
Addressing Mode Mode Register Addressing Mode Mode Register
Dy 000 reg. number:Dy (d
8
,Ay,Xi) 110 reg. number:Ay
Ay (word/longword operand only) 001 reg. number:Ay (xxx).W 111 000
(Ay) 010 reg. number:Ay (xxx).L 111 001
(Ay) + 011 reg. number:Ay #<data> 111 100
– (Ay) 100 reg. number:Ay (d
16
,PC) 111 010
(d
16
,Ay) 101 reg. number:Ay (d
8
,PC,Xi) 111 011
CMP V2, V3 Core V4 Core
Opcode present Yes Yes
Operand sizes supported .l .b, .w, .l