SAM47 INSTRUCTION SET

KS57C2308/P2308/C2316/P2316

 

 

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 “ADSA,#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 “ADSA,#im” instruction, the next instruction will not be skipped.)

Operand

 

 

 

Binary Code

 

 

 

Operation Notation

 

 

 

 

 

 

 

 

 

 

 

 

A,@HL

0

0

1

 

1

1

 

1

1

0

C, A A + (HL) + C

 

 

 

 

 

 

 

 

 

 

 

 

EA,RR

1

1

0

 

1

1

 

1

0

0

C, EA EA + RR + C

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

1

 

0

1

 

r2

r1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

RRb,EA

1

1

0

 

1

1

 

1

0

0

C, RRb RRb + EA + C

 

 

 

 

 

 

 

 

 

 

 

 

 

1

0

1

 

0

0

 

r2

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

5-24

Page 98
Image 98
Samsung KS57C2308 manual ADC Add With Carry, Adc, Operation Operand Operation Summary Bytes Cycles