This the multi-page printable view of this section.Click here to print.
Adds the source operand to the destination operand along with the extend bit, and stores the result in the destination location. The addition is performed using binary-coded decimal arithmetic. The operands, which are packed binary-coded decimal numbers, can be addressed in two different ways:
This operation is a byte operation only.
Operation: | ABCD | ||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Syntax: | ABCD Dy, Dx ABCD -(Ay), -(Ax) | ||||||||||||||||||||||||||||||||||||||||||||
Data Size: | Byte | ||||||||||||||||||||||||||||||||||||||||||||
Flags: |
X Set the same as the carry bit N Undefined Z Cleared if the result is nonzero; unchanged otherwise V Undefined C Set if a decimal carry was generated; cleared otherwise Normally, the Z condition code bit is set via programming before the start of an operation. This allows successful tests for zero results upon completion of multiple-precision operations. | ||||||||||||||||||||||||||||||||||||||||||||
Format: |
Rx the source register. Ry the destination register. R/M Specifies the operand addressing mode:
|
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:
|
Dir | Operation | Size | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \( ea + D_n \longrightarrow D_n \) | 00 | Byte | ||||||||||
1 | \( D_n + ea \longrightarrow ea \) | 01 | Word | ||||||||||
10 | Long |
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 |
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) | ‐ | ‐ |
Dn
mode is used when the destination is a data register.ea
is invalid for a data register.ADDA
is used when the destination is an address register.ADDI
and ADDQ
are used when the source is immediate data.ADD
, ADDI
and ADDQ
Adds the source operand and the extend bit to the destination operand and stores the result in the destination location. The operands can be addressed in two different ways:
The size of the operation can be specified as byte, word, or long.
Operation: | ADDX | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Syntax: | ADDX Dy, Dx ADDX -(Ay), -(Ax) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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; unchanged otherwise V Set if an overflow occurs; cleared otherwise C Set if a carry is generated; cleared otherwise Normally, the Z condition code bit is set via programming before the start of an operation. This allows successful tests for zero results upon completion of multiple-precision operations. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format: |
Rx the source register. Ry the destination register. R/M Specifies the operand addressing mode:
Size the size of the operation:
|