UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
59
ADD
Add
ADD dst, src
Operation
dst
←
dst + src
Description
Add the source operand to the destination operand. Perform two’s-complement addition.
Store the sum in the destination operand. The contents of the source operand are not
affected.
Flags
Attributes
Escaped Mode Addressing
Using Escaped Mode Addressing, address modes R or IR can specify a Working Register.
If the high nibble of the source or destination address is
EH
(1110B), a Working Register is
inferred. For example, if Working Register R12 (
CH
) is the desired destination operand,
use
ECH
as the destination operand in the opcode. To access Registers with addresses
E0H
to E
FH
, either set the Working Group Pointer, RP[7:4], to
EH
or use indirect addressing.
C
Set if there is a carry from bit 7; reset otherwise.
Z
Set if the result is zero; reset otherwise.
S
Set if the result is negative; reset otherwise.
V
Set if an arithmetic overflow occurs; reset otherwise.
D
Reset to 0.
H
Set if there is a carry from bit 3 of the result; reset otherwise.
Mnemonic
Destination, Source
Opcode (Hex)
Operand 1
Operand 2
Operand 3
ADD
r1, r2
02
{r1, r2}
—
—
ADD
r1, @r2
03
{r1, r2}
—
—
ADD
R1, R2
04
R2
R1
—
ADD
R1, @R2
05
R2
R1
—
ADD
R1, IM
06
R1
IM
—
ADD
@R1, IM
07
R1
IM
—