"Use of mnemonics" demonstrations
Use of neg and not

This test demonstrates the use of the mnemonics NEG and NOT, which are sometimes confused. Set a breakpoint at USEOF_NEGNOT and run the test, then single-step through the code.
NEG changes -1 to 1 because it reverses all the bits and adds 1.
NOT changes -1 to 0 because it reverses all the bits only.
The test also shows the effect of the mnemonics on zero and 1.
Here is the code used:-

USEOF_NEGNOT:
MOV EAX,-1
NEG EAX
MOV EAX,-1
NOT EAX
MOV EAX,0
NEG EAX
MOV EAX,0
NOT EAX
MOV EAX,1
NEG EAX
MOV EAX,1
NOT EAX
RET