neg

8086 and later

Two's Complement Negation

neg r/m8 | neg r/m16 | neg r/m32 | neg r/m64 | neg [reg8], r/m8 | neg [reg16], r/m16 | neg [reg32], r/m32 | neg [reg64], r/m64

NEG replaces the contents of its operand by the two's complement negation (invert all the bits and then add one) of the original value. NOT, similarly, performs one's complement (inverts all the bits).

Loading...

Forms

Every form of neg the assembler accepts, from NASM's own instruction table. The second column is the processor that introduced the form; a badge marks a form that needs an extension, that is lockable, or that long mode dropped.

FormSinceNotes
neg r/m88086lock
neg r/m168086lock
neg r/m32386lock
neg r/m64x86-64locklong
neg [reg8], r/m8x86-64apxlocklong
neg [reg16], r/m16x86-64apxlocklong
neg [reg32], r/m32x86-64apxlocklong
neg [reg64], r/m64x86-64apxlocklong