更新时间:2022-01-25 23:03:07
嗯,有两种方法可以做到这一点,***是将数字加载到寄存器中,然后像汉斯所说的那样使用NEG
指令,即:NEG EAX
将否定eax.另一种方法是XOR EAX,EAX SUB EAX,EDX
,其中edx包含您要取反的数字
Well, there are two ways to do this, best would be to load the number into a register, then use the NEG
instruction as Hans mention, ie: NEG EAX
would negate eax. The other way would be XOR EAX,EAX SUB EAX,EDX
where edx contains the number you want to negate