eZ80
®
CPU
User Manual
UM007714-0908 CPU Instruction Set
337
SBC HL, SP
Subtract with Carry
Operation
HL ← HL – SP – C
Description
The Stack Pointer (
SP
) and the Carry Flag (C) are subtracted from the contents of the HL
register. The result is written to HL. In ADL mode, or if the
.L
suffix is employed, the 24-
bit Stack Pointer Long (SPL) is used. In Z80 mode of if the
.S
suffix is employed, the 16-
bit Stack Pointer Short (SPS) is used.
Condition Bits Affected
Attributes
S Set if result is negative; reset otherwise.
Z Set if result is 0; reset otherwise.
H Set if borrow from bit 12; reset otherwise.
P/V Set if overflow; reset otherwise.
N Set.
C Set if borrow; reset otherwise.
Mnemonic Operand ADL Mode Cycle Opcode (hex)
SBC HL,SP X2ED, 72
SBC.S HL,SP 1352, ED, 72
SBC.L HL,SP 0349, ED, 72