|
发表于 2014-10-30 08:52:07
|
显示全部楼层
本帖最后由 zhihuzheye 于 2014-10-30 08:58 编辑
看看官方文档Intel® 64 and IA-32 Architectures是怎样描述的
NEG—Two's Complement Negation
Description
Replaces the value of operand (the destination operand) with its two's complement. (This operation is equivalent to
subtracting the operand from 0.) The destination operand is located in a general-purpose register or a memory
location.
This instruction can be used with a LOCK prefix toallow the instruction to be executed atomically.
In 64-bit mode, the instruction’s default operation size is32 bits. Using a REX prefix inthe form of REX.R permits
access to additional registers (R8-R15). Using a REX prefix in the form of REX.W promotes operation to 64 bits. See
the summary chart at the beginning of this section for encoding data and limits.
Operation
IF DEST =0
THEN CF ←0;
ELSE CF ←1;
FI;
DEST ←[– (DEST)] <-- 这一句的意思非常明确
Flags Affected
The CF flag set to 0 if the source operand is 0; otherwise it is set to 1. The OF, SF, ZF, AF, and PF flags are set
according to the result. |
|