Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- extern "C" int __fastcall sumFast(int, int);
- extern "C" int __stdcall sumStd(int, int, int);
- extern "C" int __cdecl sumCd(int, int, int);
- int main() {
- int x = 2, a = 4, b = 3;
- std::cout <<"a+b= "<< sumFast(a, b)<<std::endl;
- std::cout << "a*x+b= " << sumStd(a, b, x) << std::endl;
- std::cout << "a*x+b= " << sumCd(a, b, x) << std::endl;
- system("pause");
- return 0;
- }
- .386
- PUBLIC @sumFast@8
- .model flat
- .code
- @sumFast@8 proc
- mov eax,edx
- add eax,ecx
- ret
- @sumFast@8 endp
- PUBLIC _sumStd@12
- .model flat
- .code
- _sumStd@12 proc
- push ebp
- mov ebp,esp
- mov eax, dword ptr [ebp+16]
- mov ebx, dword ptr [ebp+12]
- mov ecx, dword ptr [ebp+8]
- imul ecx
- add eax,ebx
- pop ebp
- ret 12
- _sumStd@12 endp
- PUBLIC _sumCd
- .model flat
- .code
- _sumCd proc
- push ebp
- mov ebp,esp
- mov eax, dword ptr [ebp+16]
- mov ebx, dword ptr [ebp+12]
- mov ecx, dword ptr [ebp+8]
- imul ecx
- add eax,ebx
- pop ebp
- ret
- _sumCd endp
- end
Advertisement
Add Comment
Please, Sign In to add comment