while
void while01()
{
int i = 0;
while (i<20)
{
i++;
}
}
i<20:jge i<=20:jg i>20:jle i>=20:jl
push ebp
mov ebp,esp
sub esp,44
push ebx
push esi
push edi
mov dword ptr ss:[ebp-4],0
cmp dword ptr ss:[ebp-4],14
jge 0623_x86_x64_asm.411841
mov eax,dword ptr ss:[ebp-4]
add eax,1
mov dword ptr ss:[ebp-4],eax
jmp 0623_x86_x64_asm.411830
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
for
void for01()
{
for(int i=0;i<20;i++)
{
}
}
i<20:jge i<=20:jg i>20:jle i>=20:jl
push ebp
mov ebp,esp
sub esp,44
push ebx
push esi
push edi
mov dword ptr ss:[ebp-4],0
jmp 0623_x86_x64_asm.41177B
mov eax,dword ptr ss:[ebp-4]
add eax,1
mov dword ptr ss:[ebp-4],eax
cmp dword ptr ss:[ebp-4],14
jge 0623_x86_x64_asm.411783
jmp 0623_x86_x64_asm.411772
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
dowhile
void dowhile01()
{
int i = 0;
do
{
i++;
} while (i < 20);
}
i<20:jl i<=20:jle i>20:jg i>=20:jge
push ebp
mov ebp,esp
sub esp,44
push ebx
push esi
push edi
mov dword ptr ss:[ebp-4],0
mov eax,dword ptr ss:[ebp-4]
add eax,1
mov dword ptr ss:[ebp-4],eax
cmp dword ptr ss:[ebp-4],14
jl 0623_x86_x64_asm.411770
pop edi
pop esi
pop ebx
mov esp,ebp
pop ebp
ret
CMP影响的标志位
CF:如果最高位产生进位或者借位的时候,CF置1,否则置0 ZF:0标志位,是0为1,不是0为0 OF:溢出标志位,尖酸溢出为1,没溢出为0 SF:符号位,0为正,1为负 AF:辅助进位标志位,如果低字节中低4位产生进位或者借位的时候,则置1,否则置0 PF:奇偶标志位
条件跳转所需的条件 JG------------ZF=0&&SF=OF JGE----------SF=OF JL ------------SF!=OF JLE-----------ZF=1||SF!=OF
|