SBC HL,ss

Operation

HL <- HL - ss - CY

Mnemonic

SBC

Operands

HL,ss

b7b6b5b4b3b2b1b0
1 1 1 0 1 1 0 1$ED
0 1 ss 0010

Description

The contents of the register pair ss (any of register pairs BC, DE, HL, or SP) and the Carry Flag (C flag in the F Register) are subtracted from the contents of register pair HL, and the result is stored in HL. In the assembled object code, operand ss is specified as follows:

Register
Pair
rHex
BC00$42
DE01$52
HL10$62
SP11$72

Condition Bits Affected

Sis set if result is negative, otherwise it is reset.
Zis set if result is 0, otherwise it is reset.
His set if borrow from bit 12, otherwise it is reset.
P/Vis set if overflow, otherise it is reset.
Nis reset.
Cis set if borrow, otherwise it is reset.

Example

If the HL register pair contains $9999, register pair DE contains $1111, and the Carry flag is set, then upon the execution of

	SBC	HL,DE

HL contains $8887.