I find some misunderstanding in Disassembly of my programme.

I typed the source code in Visual Studio 6 ... ...
                    >>The source code is like this:
int main()
         int a, b=9;
         return fun( a, b );

When I went to the Debugging and opened the ... ...
                    >> The Disassembly Code is like this:
8:    int main()
9:    {
0040D400   push        ebp
0040D401   mov         ebp,esp
0040D403   sub          esp,48h     
                                ; Why was there  this line---for varibles ?
                                ; Why SUB so much? What was this for ?

0040D406   push        ebx
0040D407   push        esi
0040D408   push        edi           
                                ; Why does the assembler Push ebx, esi & edi
                                ; Saved these data for what ?

0040D409   lea           edi,
0040D40C   mov         ecx,12h
0040D411   mov         eax,0CCCCCCCCh
0040D416   rep stos    dword ptr
10:       int a, b=9;
0040D418   mov         dword ptr ,9
12:       return fun( a, b );
0040D41F   mov         eax,dword ptr
0040D422   push        eax
0040D423   mov         ecx,dword ptr
0040D426   push        ecx
0040D427   call          @ILT+5(fun) (0040100a)
0040D42C   add         esp,8
13:   }

Could any warm-heart help me ?
Thank U for transmit you idea !
Posted on 2005-11-01 19:34:55 by iNeedSpeed
Are you compiling with debug on?
Posted on 2005-11-01 20:25:47 by roticv
he must be. turn off all the debugging, but DON'T use any optimizations if you want to 'find' your code. Optimized code is somewhat more difficult to analyze if you're not familiar with c++, win32asm, code optimization, etc.
Posted on 2005-11-01 22:37:31 by ti_mo_n
ti_mo_n: thank you very much !
Posted on 2005-11-02 02:07:02 by iNeedSpeed
roticv : thank you all the same .
Posted on 2005-11-02 02:14:51 by iNeedSpeed