Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->CMP

CMP    Compare

Compatibility: 68000, 68010, 68020, CPU32 families

Destination - Source


Assembler Syntax:    CMP <ea>,Dn


<ea> - all modes

Size:    Byte, Word or Long

Subtracts the source operand from the destination data register and sets the condition codes according  to the result; the data register is not changed.


Condition Codes:

N    Set if result negative, else cleared
Z    Set if result zero, else cleared
V    Set if overflow, else cleared
C    Set if borrow, else clear
X    Not affected

    
Allowable Addressing Modes
    
CMPDn,Dn
CMPAn,Dn  not byte
CMP(An),Dn
CMP(An)+,Dn
CMP-(An),Dn
CMP(d16,An),Dn
CMP(d8,An,Xn),Dn
CMP(bd,An,Xn),Dn 2
CMP([bd,An,Xn],od),Dn 1
CMP([bd,An],Xn,od),Dn 1
CMP(xxx).W,Dn
CMP(xxx).L,Dn
CMP#(data),Dn
CMP(d16,PC),Dn
CMP(d8,PC,Xn),Dn
CMP(bd,PC,Xn),Dn 2
CMP([bd,PC,Xn],od),Dn 1
CMP([bd,PC],Xn,od),Dn 1
1   68020 only
2   68020 and CPU32 only