Samsung KS57C2308 Manual page 156

Single-chip cmos microcontroller
Table of Contents

Advertisement

SAM47 INSTRUCTION SET
SBS
— Subtract
SBS
dst,src
Operation:
Operand
A,@HL
EA,RR
RRb,EA
Description:
The source operand is subtracted from the destination operand and the result is stored in the
destination. The contents of the source are unaffected. A skip is executed if a borrow occurs. The
value of the carry flag is not affected.
Operand
A,@HL
EA,RR
RRb,EA
Examples:
1. The accumulator contains the value 0C3H, register pair HL contains the value 0C7H, and the
carry flag is cleared to logic zero:
RCF
SBS
JPS
JPS
2. The accumulator contains the value 0AFH, register pair HL contains the value 0AAH, and the
carry flag is set to logic one:
SCF
SBS
JPS
5-82
Operation Summary
Subtract indirect data memory from A; skip on borrow
Subtract register pair (RR) from EA; skip on borrow
Subtract EA from register pair (RRb); skip on borrow
Binary Code
0
0
1
1
1
0
1
0
1
1
1
0
1
0
1
EA,HL
XXX
YYY
EA,HL
XXX
1
1
1
0
1
1
1
1
0
0
1
1
r2
r1
0
1
1
1
0
0
1
0
r2
r1
0
; C
"0"
; EA
0C3H – 0C7H
; SBS instruction skips on borrow,
; but carry flag value is not affected
; Skip because a borrow occurred
; Jump to YYY is executed
; C
"1"
; EA
0AFH – 0AAH
; Jump to XXX
; JPS was not skipped since no "borrow" occurred after
SBS
KS57C2308/P2308/C2316/P2316
Bytes
1
2
2
Operation Notation
A
A – (HL); skip on borrow
EA
EA – RR; skip on borrow
RRb
RRb – EA; skip on borrow
Cycles
1 + S
2 + S
2 + S

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents