A.5.285 SBB: Subtract with Borrow
SBB r/m8,reg8 ; 18 /r [8086]
SBB r/m16,reg16 ; o16 19 /r [8086]
SBB r/m32,reg32 ; o32 19 /r [386]
SBB reg8,r/m8 ; 1A /r [8086]
SBB reg16,r/m16 ; o16 1B /r [8086]
SBB reg32,r/m32 ; o32 1B /r [386]
SBB r/m8,imm8 ; 80 /3 ib [8086]
SBB r/m16,imm16 ; o16 81 /3 iw [8086]
SBB r/m32,imm32 ; o32 81 /3 id [386]
SBB r/m16,imm8 ; o16 83 /3 ib [8086]
SBB r/m32,imm8 ; o32 83 /3 ib [386]
SBB AL,imm8 ; 1C ib [8086]
SBB AX,imm16 ; o16 1D iw [8086]
SBB EAX,imm32 ; o32 1D id [386]
SBB performs integer subtraction: it subtracts its second operand, plus
the value of the carry flag, from its first, and leaves the result in
its destination (first) operand. The flags are set according to the
result of the operation: in particular, the carry flag is affected and
can be used by a subsequent SBB instruction.
In the forms with an 8-bit immediate second operand and a longer first
operand, the second operand is considered to be signed, and is sign-
extended to the length of the first operand. The BYTE qualifier can be
used to force NASM to generate this form of the instruction. Recent
versions of NASM automatically optimise to this form if the immediate
operand's value is known during the assembling of that instruction, and
fits in the range of a signed byte. The longer variant can then still be
forced using the STRICT WORD or STRICT DWORD qualifier.
To subtract one number from another without also subtracting the
contents of the carry flag, use SUB (section A.5.305).