Subtract                                   

86/88

Y

186

Y

286

Y

386

Y

486

Y

SUB destination, source

Ovfl

Y

Dir

N

Int

N

Trap

N

Sign

Y

Zero

Y

Aux

Y

Prty

Y

Carry

Y

    SUB subtracts the source operand from the destination operand and
    stores the result in destination. Both operands may be bytes or words,
    and both may signed or unsigned binary numbers.

       Notes:         You may wish to use SBB if you need to subtract
                      numbers that are larger than 16 bits, since SBB
                      subtracts a borrow from a previous operation.

                      You may subtract a byte-length immediate value from
                      a destination which is a word; in this case, the
                      byte is sign-extended to 16 bits before the
                      subtraction.

------------------------------------ Timing ----------------------------------

OpCode          Instruction             386     286     86
2C ib           SUB AL, imm8            2       3       4
2D iw           SUB AX, imm16           2       3       4
2D id           SUB EAX, imm32          2
80/5 ib         SUB r/m8, imm8          2/7     3/7     4/17+EA
81/5 iw         SUB r/m16, imm16        2/7     3/7     4/17+EA
81/5 id         SUB r/m32, imm32        2/7
83/5 ib         SUB r/m16, imm8         2/7     3/7     4/17+EA
83/5 ib         SUB r/m32, imm8         2/7
28/r            SUB r/m8, r8            2/7     2/7     3/16+EA
29/r            SUB r/m16, r16          2/7     2/7     3/16+EA
29/r            SUB r/m32, r32          2/7
2A/r            SUB r8, r/m8            2/6     2/7     3/9+EA
2B/r            SUB r16, r/m16          2/6     2/7     3/9+EA
2B/r            SUB r32, r/m32          2/6

------------------------------------ Logic -----------------------------------

        destination = destination - source

See Also SBB DEC NEG CMP AAS DAS Flags


Copyright © 1985 to 2022 Beta Systems                            Last modified: Wednesday, January 05, 2022 .