Samsung KS57C2308 Manual page 154

Single-chip cmos microcontroller
Table of Contents

Advertisement

SAM47 INSTRUCTION SET
SBC
— Subtract With Carry
SBC
dst,src
Operation:
Operand
A,@HL
EA,RR
RRb,EA
Description:
SBC subtracts the source and carry flag value from the destination operand, leaving the result in
the destination. SBC sets the carry flag if a borrow is needed for the most significant bit;
otherwise it clears the carry flag. The contents of the source are unaffected.
If the carry flag was set before the SBC instruction was executed, a borrow was needed for the
previous step in multiple precision subtraction. In this case, the carry bit is subtracted from the
destination along with the source operand.
Operand
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 is set to "1":
SCF
SBC
JPS
2. If the extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is cleared to "0":
RCF
SBC
JPS
5-80
Operation Summary
Subtract indirect data memory from A with carry
Subtract register pair (RR) from EA with carry
Subtract EA from register pair (RRb) with carry
Binary Code
0
0
1
1
1
0
1
1
0
1
1
0
1
1
0
EA,HL
XXX
EA,HL
XXX
1
1
1
0
0
1
1
1
0
0
0
1
r2
r1
0
1
1
1
0
0
0
0
r2
r1
0
; C
"1"
; EA
0C3H – 0AAH – 1H, C
; Jump to XXX; no skip after SBC
; C
"0"
; EA
0C3H – 0AAH – 0H = 19H, C
; Jump to XXX; no skip after SBC
KS57C2308/P2308/C2316/P2316
Bytes
1
2
2
Operation Notation
C,A
A – (HL) – C
C, EA
EA –RR – C
C,RRb
RRb – EA – C
"0"
Cycles
1
2
2
"0"

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

P2308C2316P2316Ks57p2308Ks57c2316Ks57p2316

Table of Contents