SAM47 INSTRUCTION SET KS57C2308/P2308/C2316/P2316
5-24
ADC Add With Carry
ADC dst,src
Operation: Operand Operation Summary Bytes Cycles
A,@HL Add indirect data memory to A with carry 1 1
EA,RR Add register pair (RR) to EA with carry 2 2
RRb,EA Add EA to register pair (RRb) with carry 2 2
Description: The source operand, along with the setting of the carry flag, is added to the destination operand
and the sum is stored in the destination. The contents of the source are unaffected. If there is an
overflow from the most significant bit of the result, the carry flag is set; otherwise, the carry flag
is cleared.
If “ADC A,@HL” is followed by an “ADS A,#im” instruction in a program, ADC skips the ADS
instruction if an overflow occurs. If there is no overflow, the ADS instruction is executed normally.
(This condition is valid only for “ADC A,@HL” instructions. If an overflow occurs following an
“ADS A,#im” instruction, the next instruction will not be skipped.)
Operand Binary Code Operation Notation
A,@HL 00111110C, A A + (HL) + C
EA,RR 11011100C, EA EA + RR + C
10101r2 r1 0
RRb,EA 11011100C, RRb RRb + EA + C
10100r2 r1 0
Examples: 1. The extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is set to "1":
SCF ;C "1"
ADC EA,HL ;EA 0C3H + 0AAH + 1H = 6EH, C "1"
JPS XXX ;Jump to XXX; no skip after ADC
2. If the extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is cleared to "0":
RCF ;C "0"
ADC EA,HL ;EA 0C3H + 0AAH + 0H = 6DH, C "1"
JPS XXX ;Jump to XXX; no skip after ADC