
Instruction Set
4-216
SBB
Subtract Numbers with Borrow
SBB
What It Does
SBB subtracts an integer or an unsigned number and the value of the Carry Flag (CF) from
another number of the same type.
Syntax
Description
SBB adds the second operand (
subtrahend) to CF and subtracts the result from the first
operand (
difference). The result of the subtraction is assigned to the first operand and the
flags are set accordingly.
Operation It Performs
Form
Opcode
Description
Clocks
Am186 Am188
SBB AL,
imm8
1C
ib
Subtract immediate byte from AL with borrow
3
3
SBB AX,
imm16
1D
iw
Subtract immediate word from AX with borrow
4
4
SBB
r/m8,imm8
80
/3 ib
Subtract immediate byte from r/m byte with borrow
4/16
4/16
SBB
r/m16,imm16
81
/3 iw
Subtract immediate word from r/m word with borrow
4/16
4/20
SBB
r/m16,imm8
83
/3 ib
Subtract sign-extended imm. byte from r/m word with borrow
4/16
4/20
SBB
r/m8,r8
18
/r
Subtract byte register from r/m byte with borrow
3/10
3/10
SBB
r/m16,r16
19
/r
Subtract word register from r/m word with borrow
3/10
3/14
SBB
r8,r/m8
1A
/r
Subtract r/m byte from byte register with borrow
3/10
3/10
SBB
r16,r/m16
1B
/r
Subtract r/m word from word register with borrow
3/10
3/14
SBB
difference,subtrahend
if (size(
difference) == 16)
if (size(
subtrahend) == 8)
/* extend sign of subtrahend */
if (
subtrahend < 0)
subtrahend = 0xFF00 | subtrahend;
else
subtrahend = 0x00FF & subtrahend;
/* subtract with borrow */
difference = difference - subtrahend - CF;
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...