SUB              Subtract                            Flags: O D I T S Z A P C
                                                            *       * * * * *
SUB destination,source
 
          Logic:    destination  destination - source
 
    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.
 
  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
                           byte(word)
   register, register          3          -        2     SUB DX,BX
   register, memory        9(13) + EA     1       2-4    SUB DX,TOTAL
   memory, register       16(24) + EA     2       2-4    SUB RATE,CL
   accumulator, immediate      4          -       2-3    SUB AH,25
   register, immediate         4          -       3-4    SUB DX,5280
   memory, immediate      17(25) + EA     2       3-6    SUB RESULT,1032
  --------------------------------------------------------------------------
 
       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.

Seealso:



This page last updated on Fri Nov 30 10:49:50 MSK 2001
Copyright © 1992-2001, Vitaly Filatov, Moscow, Russia
Webmaster