I have a class with a member function that I wish to implement using MASM.
class Foo
{
public:
Foo() {}
~Foo() {}
int adder(int, int); // <- This should be implemented using MASM
};
;ASM source
.486
.model flat, stdcall
option casemap :none
.code
adder proc arg1:dword, arg2:dword
mov eax, arg1
add eax, arg2
ret
adder endp
end
I know how to implement C function, but now C++. I have read this
http://www.codeproject.com/cpp/Using...nesVisualC.asp but with no success. How, and where, do I declare the function? Something like
extern "C" int __stdcall adder(int, int);
or similiar should be somewhere I guess...
int main()
{
Foo foo = Foo();
foo.adder(1, 2);
} This does not work, cause I don't know how to declare the function. Anyone who can help me out with this?
/Thanks for your help!
/Klarre