
Z8 Microcontrollers
Instruction Descriptions and Formats
ZiLOG
12-64
UM001600-Z8X0599
SBC
SUBTRACT WITH CARRY
Example:
Working Register R3 contains 16H, the C Flag is set to 1, and Working Register R11 contains 20H, the
statement:
SBC R3, R11
Op Code: 32 3B
leaves the value F5H in Working Register R3. The C, S, and D Flags are set, and the Z, V, and H Flags
are all cleared.
Example:
If Working Register R15 contains 16H, the C Flag is not set, Working Register R10 contains 20H, and
Register 20H contains 11H, the statement:
SBC R16, @R10
Op Code: 33 FA
leaves the value 05H in Working Register R15. The D Flag is set, and the C, Z, S, V, and H Flags are
cleared.
Example
:If Register 34H contains 2EH, the C Flag is set, and Register 12H contains 1BH, the statement:
SBC 34H, 12H
Op Code: 34 12 34
leaves the value 13H in Register 34H. The D Flag is set, and the C, Z, S, V, and H Flags are cleared.
Example:
If Register 4BH contains 82H, the C Flag is set, Working Register R3 contains 10H, and Register 10H
contains 01H, the statement:
SBC 4BH, @R3
Op Code: 35 E3 4B
leaves the value 80H in Register 4BH. The D Flag is set, and the C, Z, S, V, and H Flags are cleared.
Example:
If Register 6CH contains 2AH, and the C Flag is not set, the statement:
SBC 6CH, #03H
Op Code: 36 6C 03
leaves the value 27H in Register 6CH. The D Flag is set, and the C, Z, S, V, and H Flags are cleared.
Example:
If Register D4H contains 5FH, Register 5FH contains 4CH, and the C Flag is set, the statement:
SBC @D4H, #02H
Op Code: 37 D4 02
leaves the value 4AH in Register 5FH. The D Flag is set, and the C, Z, S, V, and H Flags are cleared.