Hello everyone,
I am confused what is the function of the 4 assembly instructions? I posted the 4 assembly instructions and related whole source code/assembly code below.
Any ideas?
Code:
00BA13CC lea edi,[ebp-0C0h]
00BA13D2 mov ecx,30h
00BA13D7 mov eax,0CCCCCCCCh
00BA13DC rep stos dword ptr es:[edi]
int sumExample (int a, int b)
{
00BA13C0 push ebp
00BA13C1 mov ebp,esp
00BA13C3 sub esp,0C0h
00BA13C9 push ebx
00BA13CA push esi
00BA13CB push edi
00BA13CC lea edi,[ebp-0C0h]
00BA13D2 mov ecx,30h
00BA13D7 mov eax,0CCCCCCCCh
00BA13DC rep stos dword ptr es:[edi]
return a + b;
00BA13DE mov eax,dword ptr [a]
00BA13E1 add eax,dword ptr [b]
}
#include <iostream>
using namespace std;
int sumExample (int a, int b)
{
return a + b;
}
int main()
{
int c = sumExample (100, 200);
cout << c << endl;
return 0;
}
thanks in advance,
George