KS57C2308/P2308/C2316/P2316

SAM47 INSTRUCTION SET

 

 

ADC and SBC Instruction Skip Conditions

The instructions “ADC A,@HL” and “SBC A,@HL” can generate a skip signal, and set or clear the carry flag, when they are executed in combination with the instruction “ADSA,#im”.

If an “ADSA,#im” instruction immediately follows an “ADC A,@HL” or “SBC A,@HL” instruction in a program sequence, the ADS instruction does not skip the instruction following ADS, even if it has a skip function. If, however, an “ADC A,@HL” or “SBC A,@HL” instruction is immediately followed by an “ADSA,#im” instruction, the ADC (or SBC) skips on overflow (or if there is no borrow) to the instruction immediately following the ADS, and program execution continues. Table 5-3 contains additional information and examples of the “ADC A,@HL” and “SBC A,@HL” skip feature.

Table 5-3. Skip Conditions for ADC and SBC Instructions

Sample

 

If the result of

Then, the execution

Reason

Instruction Sequences

instruction 1 is:

sequence is:

 

 

 

 

 

 

 

ADC A,@HL

 

1

Overflow

1, 3, 4

ADS cannot skip

ADS A,#im

 

2

 

 

instruction 3, even if it

xxx

 

3

No overflow

1, 2, 3, 4

has a skip function.

xxx

 

4

 

 

 

 

 

 

 

 

 

SBC A,@HL

 

1

Borrow

1, 2, 3, 4

ADS cannot skip

ADS A,#im

 

2

 

 

instruction 3, even if it

xxx

 

3

No borrow

1, 3, 4

has a skip function.

xxx

 

4

 

 

 

 

 

 

 

 

 

5-5

Page 79
Image 79
Samsung KS57C2308 manual ADC and SBC Instruction Skip Conditions, Adc A,@Hl, Sbc A,@Hl