13.07.2015 Views

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

Volume 3: General-Purpose and System Instructions - Stanford ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

AMD64 Technology 24594 Rev. 3.10 February 2005NEGTwo’s Complement NegationPerforms the two’s complement negation of the value in the specified register ormemory location by subtracting the value from 0. Use this instruction only on signedinteger numbers.If the value is 0, the instruction clears the CF flag to 0; otherwise, it sets CF to 1. TheOF, SF, ZF, AF, <strong>and</strong> PF flag settings depend on the result of the operation.The forms of the NEG instruction that write to memory support the LOCK prefix. Fordetails about the LOCK prefix, see “Lock Prefix” on page 10.Mnemonic Opcode DescriptionNEG reg/mem8 F6 /3NEG reg/mem16 F7 /3NEG reg/mem32 F7 /3NEG reg/mem64 F7 /3Performs a two’s complement negation on an 8-bit register ormemory oper<strong>and</strong>.Performs a two’s complement negation on a 16-bit register ormemory oper<strong>and</strong>.Performs a two’s complement negation on a 32-bit register ormemory oper<strong>and</strong>.Performs a two’s complement negation on a 64-bit register ormemory oper<strong>and</strong>.Related <strong>Instructions</strong>AND, NOT, OR, XOR212 NEG

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!