//___逻辑取反 !______________________________________________________
非零值取反得到0, 0取反得到1
int i, j;
i = 0x8877;
j = !i;
反汇编代码:
MOV DWORD PTR SS:[EBP-4], 0X4321
XOR EAX, EAX
CMP DWORD PTR SS:[EBP-4], 0
SETE AL //取标志寄存器中ZF的值, 放到AL中. SETNE取得ZF值后, 取反, 再放到AL中.
MOV DWORD PTR SS:[EBP-8], EAX
XOR EAX, EAX
//___按位取反 ~_______________________________________________________
汇编指令NOT, 将操作数的二进制位取反, 注意操作数的长度.
时间: 2024-10-25 06:52:14