P
Protoman
I'm trying to link this ASM file:
..486
..model flat
..stack
..code
_sample proc
push ebp
mov ebp,esp
sub esp,8
push eax
mov eax,[ebp+4]
mul dword ptr[ebp+8]
add eax,10
pop eax
mov esp,ebp
pop ebp
ret
_sample endp
end _sample
to this C++ program:
#include <iostream>
#include <cstdlib>
using std::cout;
using std::endl;
using std::system;
extern "C" {int sample();}
int main()
{
cout << sample() << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
My compiler is Dev-Cpp and my assembler is MASM32. Am I supposed to
create a project w/ the ASM file's object file in it, or what? Any help
would be greatly appreciated. Thanks!!!!
..486
..model flat
..stack
..code
_sample proc
push ebp
mov ebp,esp
sub esp,8
push eax
mov eax,[ebp+4]
mul dword ptr[ebp+8]
add eax,10
pop eax
mov esp,ebp
pop ebp
ret
_sample endp
end _sample
to this C++ program:
#include <iostream>
#include <cstdlib>
using std::cout;
using std::endl;
using std::system;
extern "C" {int sample();}
int main()
{
cout << sample() << endl;
system("PAUSE");
return EXIT_SUCCESS;
}
My compiler is Dev-Cpp and my assembler is MASM32. Am I supposed to
create a project w/ the ASM file's object file in it, or what? Any help
would be greatly appreciated. Thanks!!!!