Intel 64 and IA-32 Architectures Software Developers Manual Volume 2B, Instruction Set Reference, N-Z
Vol. 2B 4-283
INSTRUCTION SET REFERENCE, N-Z
Description
Adds the source operand (second operand) and the carry (CF) flag, and subtracts the
result from the destination operand (first operand). The result of the subtraction is
stored in the destination operand. The destination operand can be a register or a
memory location; the source operand can be an immediate, a register, or a memory
location. (However, two memory operands cannot be used in one instruction.) The
state of the CF flag represents a borrow from a previous subtraction.
When an immediate value is used as an operand, it is sign-extended to the length of
the destination operand format.
The SBB instruction does not distinguish between signed or unsigned operands.
Instead, the processor evaluates the result for both data types and sets the OF and
CF flags to indicate a borrow in the signed or unsigned result, respectively. The SF
flag indicates the sign of the signed result.
The SBB instruction is usually executed as part of a multibyte or multiword subtrac-
tion in which a SUB instruction is followed by a SBB instruction.
This instruction can be used with a LOCK prefix to allow the instruction to be
executed atomically.
In 64-bit mode, the instruction’s default operation size is 32 bits. Using a REX prefix
in the form of REX.R permits access to additional registers (R8-R15). Using a REX
prefix in the form of REX.W promotes operation to 64 bits. See the summary chart at
the beginning of this section for encoding data and limits.
Opcode Instruction
64-Bit
Mode
Compat/
Leg Mode Description
REX.W + 19 /r SBB r/m64, r64 Valid N.E. Subtract with borrow r64
from r/m64.
1A /r SBB r8, r/m8 Valid Valid Subtract with borrow r/m8
from r8.
REX + 1A /r SBB r8*, r/m8* Valid N.E. Subtract with borrow r/m8
from r8.
1B /r SBB r16, r/m16 Valid Valid Subtract with borrow
r/m16 from r16.
1B /r SBB r32, r/m32 Valid Valid Subtract with borrow
r/m32 from r32.
REX.W + 1B /r SBB r64, r/m64 Valid N.E. Subtract with borrow
r/m64 from r64.
NOTES:
* In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix
is used: AH, BH, CH, DH.