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 |
|
| SUB | Dn,Dn | | |
| SUB | An,Dn (not byte) | | |
| SUB | (An),Dn | SUB | Dn,(An) |
| SUB | (An)+,Dn | SUB | Dn,(An)+ |
| SUB | -(An),Dn | SUB | Dn,-(An) |
| SUB | (d16,An),Dn | SUB | Dn,(d16,An) |
| SUB | (d8,An,Xn),Dn | SUB | Dn,(d8,An,Xn) |
| SUB | (bd,An,Xn),Dn 2 | SUB | Dn,(bd,An,Xn) 2 |
| SUB | ([bd,An,Xn],od),Dn 1 | SUB | Dn,([bd,An,Xn],od) 1 |
| SUB | ([bd,An],Xn,od),Dn 1 | SUB | Dn,([bd,An],Xn,od) 1 |
| SUB | (xxx).W,Dn | SUB | Dn,(xxx).W |
| SUB | (xxx).L,Dn | SUB | Dn,(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