![](http://datasheet.mmic.net.cn/380000/-PD784928Y_datasheet_16744934/-PD784928Y_307.png)
307
CHAPTER 7 DESCRIPTION OF INSTRUCTIONS
Add with Carry
Byte Data Addition including Carry
[Instruction format]
ADDC dst, src
[Operation]
dst, CY
←
dst + src + CY
[Operands]
Mnemonic
Operands (dst, src)
Mnemonic
Operands (dst, src)
ADDC
A, #byte
ADDC
A, [saddrp]
r, #byte
A, [%saddrg]
saddr, #byte
[saddrp], A
sfr, #byte
[%saddrg], A
r, r’
A, !addr16
A, saddr2
A, !!addr24
r, saddr
!addr16, A
saddr, r
!!addr24, A
r, sfr
A, mem
sfr, r
mem, A
saddr, saddr’
[Flags]
S
Z
AC
P/V
CY
×
×
×
V
×
[Description]
The source operand (src) specified by the 2nd operand and the CY flag are added to the destination operand
(dst) specified by the 1st operand, and the result is stored in the destination operand (dst) and the CY flag. This
instruction is mainly used when performing multiple byte addition.
The S flag is set (1) if bit 7 of dst is set (1) as a result of the addition, and cleared (0) otherwise.
The Z flag is set (1) if dst is 0 as a result of the addition, and cleared (0) otherwise.
The AC flag is set (1) if a carry is generated out of bit 3 into bit 4 as a result of the addition, and cleared (0)
otherwise.
The P/V flag is set (1) if a carry is generated out of bit 6 into bit 7 and a carry is not generated out of bit 7 as
a result of the addition (when overflow is generated by a two’s complement type operation), or if a carry is not
generated out of bit 6 into bit 7 and a carry is generated out of bit 7 (when underflow is generated by a two’s
complement type operation), and is cleared (0) otherwise.
The CY flag is set (1) if a carry is generated out of bit 7 as a result of the addition, and cleared (0) otherwise.
[Coding example]
ADDC A, 12345H [B] ; Adds the contents of address (12345H + (B register)) and the CY flag to the A register,
and stores the result in the A register
ADDC