ADD
Adds the source operand to the destination operand using binary addition and stores the result in the destination location. The size of the operation may be specified as byte, word, or long. The mode of the instruction indicates which operand is the source and which is the destination, as well as the operand size.
Operation: | ADD | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Syntax: | ADD ea, Dn ADD Dn, ea | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Data Size: | Byte Word Long | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Flags: |
X Set the same as the carry bit N Set if the result is negative; cleared otherwise Z Cleared if the result is nonzero; set if zero V Set if an overflow occurs; cleared otherwise C Set if a carry is generated; cleared otherwise | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format: |
Op Mode:
|
Op Mode
Dir | Operation | Size | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \( ea + D_n \longrightarrow D_n \) | 00 | Byte | ||||||||||
1 | \( D_n + ea \longrightarrow ea \) | 01 | Word | ||||||||||
10 | Long |
Effective Address— Determines the addressing mode
- If the location specified is a source operand, all addressing modes can be used as listed in the following table:
Addressing Mode Mode Register Addressing Mode Mode Register Dn 000 Dn (xxx).W 111 000 An [1] 001 An (xxx).L 111 001 (An) 010 An #<data> 111 100 (An)+ 011 An -(An) 100 An (D16,An) 101 An (D16,PC) 111 010 (D8,An,Xn) 110 An (D8,PC,Xn) 111 011 - Word and long only
-
If the location specified is a destination operand, only memory alterable
addressing modes can be used as listed in the following table:
Addressing Mode Mode Register Addressing Mode Mode Register Dn ‐ ‐ (xxx).W 111 000 An ‐ ‐ (xxx).L 111 001 (An) 010 An #<data> ‐ ‐ (An)+ 011 An -(An) 100 An (D16,An) 101 An (D16,PC) ‐ ‐ (D8,An,Xn) 110 An (D8,PC,Xn) ‐ ‐
Note
- The
Dn
mode is used when the destination is a data register. - The destination
ea
is invalid for a data register. ADDA
is used when the destination is an address register.ADDI
andADDQ
are used when the source is immediate data.- Most assemblers handle the distinction between
ADD
,ADDI
andADDQ
Last modified June 10, 2022: instruction fields (f3b3701)