NEG              Negate                              Flags: O D I T S Z A P C
                                                            *       * * * * *
NEG destination
 
          Logic:    destination  -destination      ; two's complement
 
    NEG subtracts the destination operand from 0 and returns the result in
    the destination. This effectively produces the two's complement of the
    operand. The operand may be a byte or a word.
 
  --------------------------------------------------------------------------
   Operands                  Clocks   Transfers  Bytes   Example
                           byte(word)
   register                    3          -        2     NEG DL
   memory                 16(24) + EA     2       2-4    NEG COEFFICIENT
  --------------------------------------------------------------------------
 
       Note:          If the operand is zero, the carry flag is cleared;
                      in all other cases, the carry flag is set.
 
                      Attempting to negate a byte containing -128 or a
                      word containing -32,768 causes no change to the
                      operand and sets the Overflow Flag.

Seealso:



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