وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

NEG

NEG

 Usage:  NEG     dest                                Modifies flags: AF CF OF PF SF ZF

 Subtracts the 'dest'  from 0 and saves the two's complement of 'dest' back into 'dest'.

Two's and One's Complement


NEG r/m8                      ; F6 /3                [8086]

NEG r/m16                     ; o16 F7 /3            [8086]

NEG r/m32                     ; o32 F7 /3            [386]


NOT r/m8                      ; F6 /2                [8086]

NOT r/m16                     ; o16 F7 /2            [8086]

NOT r/m32                     ; o32 F7 /2            [386]


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 the one's complement (inverts all the bits, but does not add one).


Example:

mov eax 5

neg eax ; eax = FFFF FFFB > -5


NEG