Samsung KS57C2308 Manual page 98

Single-chip cmos microcontroller
Table of Contents

Advertisement

SAM47 INSTRUCTION SET
ADC
— Add With Carry
ADC
dst,src
Operation:
Operand
A,@HL
EA,RR
RRb,EA
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
A,@HL
EA,RR
RRb,EA
Examples:
1. The extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is set to "1":
SCF
ADC
JPS
2. If the extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is cleared to "0":
RCF
ADC
JPS
5-24
Operation Summary
Add indirect data memory to A with carry
Add register pair (RR) to EA with carry
Add EA to register pair (RRb) with carry
Binary Code
0
0
1
1
1
0
1
0
1
1
1
0
1
0
1
EA,HL
XXX
EA,HL
XXX
1
1
1
1
0
1
1
1
0
0
0
1
r2
r1
0
1
1
1
0
0
0
0
r2
r1
0
; C
"1"
; EA
0C3H + 0AAH + 1H = 6EH, C
; Jump to XXX; no skip after ADC
; C
"0"
; EA
0C3H + 0AAH + 0H = 6DH, C
; Jump to XXX; no skip after ADC
KS57C2308/P2308/C2316/P2316
Bytes
1
2
2
Operation Notation
C, A
A + (HL) + C
C, EA
EA + RR + C
C, RRb
RRb + EA + C
"1"
"1"
Cycles
1
2
2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents