ADD Instruction

Purpose:To perform arithmetic addition
Format:opcode add.rx, sum.mx
opcode add1.rx, add2.rx, sum.wx
Operation:sum <- sum + add;
sum <- add1 + add2;
Condition
Codes:
N <- sum LSS 0;
Z <- sum EQL 0;
V <- overflow;
C <- {carry from the most significant bit} (Integer);
C <- 0 (Floating);
Exceptions:Integer Overflow;
Floating Overflow;
Floating Underflow;
Reserved Operand (Float)
Opcodes:
80ADDB2Add Byte 2 Operand
81ADDB3Add Byte 3 Operand
A0ADDW2Add Word 3 Operand
A1ADDW3Add Word 2 Operand
C0ADDL2Add Long 2 Operand
C1ADDL3Add Long 3 Operand
40ADDF2Add Float 2 Operand
41ADDF3Add Float 3 Operand
60ADDD2Add Double 2 Operand
61ADDD3Add Double 3 Operand
Description: In the 2 operand format, the addend operand is added to the sum operand and the sum operand is replaced with the result. The addend operand is unaffected.

In the 3 Operand format, the addend 1 and addend 2 operands are added together and the sum operand is replaced with the result.The addend operands are unaffected.

In floating point format, the result is rounded.

Notes:
1.
Integer overflow occurs if the input operands to the add have the same sign and the result has the opposite sign. On overflow, the sum operand is replaced by the low order bits of the true result.
2.
On a floating reserved operand fault, the sum is unaffected and the condition codes are unpredictable.
3.
On floating underflow, the sum operand is replaced by 0.
4.
On floating overflow, the sum is replaced by an operand of all 0 bits except for the sign bit of 1 (a reserved operand (-1)). N <- 1; Z <- 0; V <- 1; and C <- 0.