You are here : assembly8086NEG

NEG - 8086

Negate. Makes operand negative (two's complement).

Algorithm:

  • Invert all bits of the operand
  • Add 1 to inverted operand


Syntax

NEG Reg
NEG memory


Example

MOV AL, 5 ; AL = 05h
NEG AL ; AL = 0FBh (-5)
NEG AL ; AL = 05h (5)
RET


Output / Return Value


Limitations


Alternatives / See Also


Reference