SAM47 INSTRUCTION SET
KS57C2308/P2308/C2316/P2316
5-82
SBS
— Subtract
SBS
dst,src
Operation:
Operand
Operation Summary
Bytes
Cycles
A,@HL
Subtract indirect data memory from A; skip on borrow
1
1 + S
EA,RR
Subtract register pair (RR) from EA; skip on borrow
2
2 + S
RRb,EA
Subtract EA from register pair (RRb); skip on borrow
2
2 + S
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
Binary Code
Operation Notation
A,@HL
0
0
1
1
1
1
0
1
A
←
A – (HL); skip on borrow
EA,RR
1
1
0
1
1
1
0
0
EA
←
EA – RR; skip on borrow
1
0
1
1
1
r2
r1
0
RRb,EA
1
1
0
1
1
1
0
0
RRb
←
RRb – EA; skip on borrow
1
0
1
1
0
r2
r1
0
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
; C
←
"0"
SBS
EA,HL
; EA
←
0C3H – 0C7H
; SBS instruction skips on borrow,
; but carry flag value is not affected
JPS
XXX
; Skip because a borrow occurred
JPS
YYY
; Jump to YYY is executed
2. The accumulator contains the value 0AFH, register pair HL contains the value 0AAH, and the
carry flag is set to logic one:
SCF
; C
←
"1"
SBS
EA,HL
; EA
←
0AFH – 0AAH
JPS
XXX
; Jump to XXX
; JPS was not skipped since no "borrow" occurred after
SBS
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: ......