The 8080 sets the carry flag when the unsigned value subtracted is greater than the unsigned value it is subtracted from. So for SUB B
carry is set if and only if the unsigned value of B
register is greater than the unsigned value of A
register.
What the manual is getting at is that subtraction can be performed by adding the two's complement of the value being subtracted. In that case a carry would result when the subtracted value is smaller than or equal to the value being subtracted from. Thus they point out that the carry flag takes on the opposite of that carry from adding the 2's complement.
I can only guess that the manual mentions this because the 8080 performs the subtraction this way internally or that an electrical engineer would naturally think of performing subtraction in this way and might be surprised that carry is not what they might expect.
However, rest assured that it treats the carry flag consistently so that multi-byte subtraction can be performed with SUB
and SBB
instructions. For example, this code will subtract the 24 bit value in BCD
from the 24 bit value in EHL
:
LD A,L
SUB D
LD L,A
LD A,H
SBB C
LD H,A
LD A,E
SBB B
LD E,A