CWangChao

深入浅出,厚积薄发,有一技之长才能立足于一席之地!

博客园 首页 新随笔 联系 订阅 管理

 

#include "stdio.h"
int function(int a,int b)
{
    int c=a+b;
    int i=0;
    while(i<50)
    {
        c=c+i;
    }
    return c;
}
void main()
{
    function(1,2);

}


 

--- c:\users\wangchao\desktop\test\test\main.cpp -------------------------------
#include "stdio.h"
int function(int a,int b)
{
00AE1A40 push ebp
00AE1A41 mov ebp,esp
00AE1A43 sub esp,0D8h
00AE1A49 push ebx
00AE1A4A push esi
00AE1A4B push edi
00AE1A4C lea edi,[ebp-0D8h]
00AE1A52 mov ecx,36h
00AE1A57 mov eax,0CCCCCCCCh
00AE1A5C rep stos dword ptr es:[edi]
    int c=a+b;
00AE1A5E mov eax,dword ptr [a]
00AE1A61 add eax,dword ptr [b]
00AE1A64 mov dword ptr [c],eax
    int i=0;
00AE1A67 mov dword ptr [i],0
    while(i<50)
00AE1A6E cmp dword ptr [i],32h
00AE1A72 jge function+3Fh (0AE1A7Fh)
    {
        c=c+i;
00AE1A74 mov eax,dword ptr [c]
00AE1A77 add eax,dword ptr [i]
00AE1A7A mov dword ptr [c],eax
    }
00AE1A7D jmp function+2Eh (0AE1A6Eh)
    return c;
00AE1A7F mov eax,dword ptr [c]
}
00AE1A82 pop edi
00AE1A83 pop esi
00AE1A84 pop ebx
00AE1A85 mov esp,ebp
00AE1A87 pop ebp

00AE1A88 ret

posted on 2010-07-01 20:37  CWangChao  阅读(174)  评论(1)    收藏  举报