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).
neg
8086 and laterTwo'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/m64Loading...
Forms
Every form of neg the assembler accepts.
| Form | Since | Notes |
|---|---|---|
| neg r/m8 | 8086 | lock |
| neg r/m16 | 8086 | lock |
| neg r/m32 | 386 | lock |
| neg r/m64 | x86-64 | locklong |
| neg [reg8], r/m8 | x86-64 | apxlocklong |
| neg [reg16], r/m16 | x86-64 | apxlocklong |
| neg [reg32], r/m32 | x86-64 | apxlocklong |
| neg [reg64], r/m64 | x86-64 | apxlocklong |