SAM47 INSTRUCTION SET
KS57C2308/P2308/C2316/P2316
5-26
ADS
— Add And Skip On Overflow
ADS
dst,src
Operation:
Operand
Operation Summary
Bytes
Cycles
A, #im
Add 4-bit immediate data to A and skip on overflow
1
1 + S
EA,#imm
Add 8-bit immediate data to EA and skip on overflow
2
2 + S
A,@HL
Add indirect data memory to A and skip on overflow
1
1 + S
EA,RR
Add register pair (RR) contents to EA and skip on
overflow
2
2 + S
RRb,EA
Add EA to register pair (RRb) and skip on overflow
2
2 + S
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
Binary Code
Operation Notation
A, #im
1
0
1
0
d3
d2
d1
d0
A
←
A + im; skip on overflow
EA,#imm
1
1
0
0
1
0
0
1
EA
←
EA + imm; skip on overflow
d7
d6
d5
d4
d3
d2
d1
d0
A,@HL
0
0
1
1
1
1
1
1
A
←
A + (HL); skip on overflow
EA,RR
1
1
0
1
1
1
0
0
EA
←
EA + RR; skip on overflow
1
0
0
1
1
r2
r1
0
RRb,EA
1
1
0
1
1
1
0
0
RRb
←
RRb + EA; skip on overflow
1
0
0
1
0
r2
r1
0
Examples:
1. The extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag = "0":
ADS
EA,HL
; EA
←
0C3H + 0AAH = 6DH
; ADS skips on overflow, but carry flag value is not
affected.
JPS
XXX
; This instruction is skipped since ADS had an overflow.
JPS
YYY
; Jump to YYY.
Summary of Contents for KS57C2308
Page 30: ...ADDRESS SPACES KS57C2308 P2308 C2316 P2316 2 22 NOTES ...
Page 168: ...SAM47 INSTRUCTION SET KS57C2308 P2308 C2316 P2316 5 94 NOTES ...
Page 170: ......
Page 206: ...POWER DOWN KS57C2308 P2308 C2316 P2316 8 8 NOTES ...
Page 210: ...RESET KS57C2308 P2308 C2316 P2316 9 4 NOTES ...
Page 222: ...I O PORTS KS57C2308 P2308 C2316 P2316 10 12 NOTES ...
Page 272: ...LCD CONTROLLER DRIVER KS57C2308 P2308 C2316 P2316 12 24 NOTES ...
Page 280: ...SERIAL I O INTERFACE KS57C2308 P2308 C2316 P2316 13 8 NOTES ...
Page 294: ...MECHANICAL DATA KS57C2308 P2308 C2316 P2316 15 2 NOTES ...
Page 310: ...KS57P2308 P2316 OTP KS57C2308 P2308 C2316 P2316 16 16 NOTES ...
Page 318: ......
Page 320: ......
Page 322: ......
Page 325: ......
Page 327: ......