a&&(b=b+2,c=c+3)
cmp DWORD PTR _a$[ebp], 0 je SHORT $L221 mov eax, DWORD PTR _b$[ebp] add eax, 2 mov DWORD PTR _b$[ebp], eax mov ecx, DWORD PTR _c$[ebp] add ecx, 3 mov DWORD PTR _c$[ebp], ecx
if(a){b=b+2;c=c+3;}
cmp DWORD PTR _a$[ebp], 0 je SHORT $L221 ;&&->je mov eax, DWORD PTR _b$[ebp] add eax, 2 mov DWORD PTR _b$[ebp], eax mov ecx, DWORD PTR _c$[ebp] add ecx, 3 mov DWORD PTR _c$[ebp], ecx
a||(b=b+2,c=c+3);
cmp DWORD PTR _a$[ebp], 0 jne SHORT $L221 ;||->jne mov eax, DWORD PTR _b$[ebp] add eax, 2 mov DWORD PTR _b$[ebp], eax mov ecx, DWORD PTR _c$[ebp] add ecx, 3 mov DWORD PTR _c$[ebp], ecx
&&,||最终会被翻译成je和jne跳转
完全等价于if语句,不过当逻辑表达式作为判断条件时
if(a&&b){}
会在后面加上test eax,eax作为jmp的依据