Samsung KS57C2308 Manual page 100

Single-chip cmos microcontroller
Table of Contents

Advertisement

SAM47 INSTRUCTION SET
ADS
— Add And Skip On Overflow
ADS
dst,src
Operation:
Operand
A, #im
EA,#imm
A,@HL
EA,RR
RRb,EA
Description:
The source operand 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 skip signal is generated and a skip is executed, but the carry flag value is
unaffected.
If "ADS A,#im" follows an "ADC A,@HL" 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 skip
condition is valid only for "ADC A,@HL" instructions, however. If an overflow occurs following an
ADS instruction, the next instruction is not skipped.
Operand
A, #im
EA,#imm
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 = "0":
ADS
JPS
JPS
5-26
Operation Summary
Add 4-bit immediate data to A and skip on overflow
Add 8-bit immediate data to EA and skip on overflow
Add indirect data memory to A and skip on overflow
Add register pair (RR) contents to EA and skip on
overflow
Add EA to register pair (RRb) and skip on overflow
Binary Code
1
0
1
1
1
0
d7
d6
d5
d4
0
0
1
1
1
0
1
0
0
1
1
0
1
0
0
EA,HL
XXX
YYY
0
d3
d2
d1
d0 A
0
1
0
0
1
d3
d2
d1
d0
1
1
1
1
1
1
1
1
0
0
1
1
r2
r1
0
1
1
1
0
0
1
0
r2
r1
0
; EA
0C3H + 0AAH = 6DH
; ADS skips on overflow, but carry flag value is not
affected.
; This instruction is skipped since ADS had an overflow.
; Jump to YYY.
KS57C2308/P2308/C2316/P2316
Bytes
1
2
1
2
2
Operation Notation
A + im; skip on overflow
EA
EA + imm; skip on overflow
A
A + (HL); skip on overflow
EA
EA + RR; skip on overflow
RRb
RRb + EA; skip on overflow
Cycles
1 + S
2 + S
1 + S
2 + S
2 + S

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents