Crossware

Table of Contents        Previous topic       Next topic       

MICROPROCESSOR INSTRUCTION REFERENCE->SUB

SUB    Subtract Binary

Compatibility: 68000, 68010, 68020 and CPU32 families.


Destination - Source  -> Destination


Assembler Syntax:SUB <ea>,Dn
SUB Dn,<ea>

Source <ea> - all modes
Destination <ea>  - alterable memory

Size:  Byte, Word or Long

Subtracts the source operand from the destination operand and stores the result in the destination.


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 cleared
X    Set same as carry

    
Allowable Addressing Modes
    
<ea>,Dn Dn,<ea>
    
SUBDn,Dn
SUBAn,Dn (not byte)
SUB(An),Dn SUBDn,(An)
SUB(An)+,DnSUBDn,(An)+
SUB-(An),DnSUBDn,-(An)
SUB(d16,An),DnSUBDn,(d16,An)
SUB(d8,An,Xn),DnSUBDn,(d8,An,Xn)
SUB(bd,An,Xn),Dn 2SUBDn,(bd,An,Xn) 2
SUB([bd,An,Xn],od),Dn 1SUBDn,([bd,An,Xn],od) 1
SUB([bd,An],Xn,od),Dn 1SUBDn,([bd,An],Xn,od) 1
SUB(xxx).W,DnSUBDn,(xxx).W
SUB(xxx).L,DnSUBDn,(xxx).L
SUB#(data),Dn
SUB(d16,PC),Dn
SUB(d8,PC,Xn),Dn
SUB(bd,PC,Xn),Dn 2
SUB([bd,PC,Xn],od),Dn 1
SUB([bd,PC],Xn,od),Dn 1
1   68020 only
2   68020 and CPU32 only