SAM47 INSTRUCTION SET
KS57C2308/P2308/C2316/P2316
5-80
SBC
— Subtract With Carry
SBC
dst,src
Operation:
Operand
Operation Summary
Bytes
Cycles
A,@HL
Subtract indirect data memory from A with carry
1
1
EA,RR
Subtract register pair (RR) from EA with carry
2
2
RRb,EA
Subtract EA from register pair (RRb) with carry
2
2
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
Binary Code
Operation Notation
A,@HL
0
0
1
1
1
1
0
0
C,A
←
A – (HL) – C
EA,RR
1
1
0
1
1
1
0
0
C, EA
←
EA –RR – C
1
1
0
0
1
r2
r1
0
RRb,EA
1
1
0
1
1
1
0
0
C,RRb
←
RRb – EA – C
1
1
0
0
0
r2
r1
0
Examples:
1. The extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is set to "1":
SCF
; C
←
"1"
SBC
EA,HL
; EA
←
0C3H – 0AAH – 1H, C
←
"0"
JPS
XXX
; Jump to XXX; no skip after SBC
2. If the extended accumulator contains the value 0C3H, register pair HL the value 0AAH, and
the carry flag is cleared to "0":
RCF
; C
←
"0"
SBC
EA,HL
; EA
←
0C3H – 0AAH – 0H = 19H, C
←
"0"
JPS
XXX
; Jump to XXX; no skip after SBC
Summary of Contents for C2316
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: ......