Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Assembly Language - <b>sub subtract flags: o d i t s z a p c</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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.

See Also: SBB DEC NEG CMP AAS DAS EA Flags

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson