i'm new to this. well, not completely new, but my knowledge is too limited to solve my problem.

i have a working win32 c++ program which works fine, but i need a fast calculating routine.

so i wrote an assembler procedure for testing purposes which should be called from the c++ program.

here's the *.asm-file:

.model flat, stdcall
option casemap:none


PUBLIC dummy
dummy DWORD 66




mov eax,
sub eax, 06h
mov , eax


END start

ok, i got the object-file and included in my c++-projekt, which has the following lines of code at the beginning:


extern void STDCALL ASMPROC(void);


it doesn't work when i try to call ASMPROC(), gives an undefined reference.

i'm desperate...please help
thank you
Posted on 2002-03-09 08:17:02 by 08/15
You could try to use inline assembler like this:

__asm {
some code
__asm xor eax, eax

and you must have ml.exe in your bin directory.
Posted on 2002-03-09 08:30:10 by ante
i should have mentioned that i'm using Dev-C++ and mingW-compiler.

you're right, but really want to keep the asm stuff separate from the c++ code. so i decided to link the object files together (btw, it works for just accessing data).

thx for your idea!
Posted on 2002-03-09 08:40:39 by 08/15
Using Masm with C++ I learned here, I use Visual C++ though
but maybe you will find enough info here in this post


I started the post, and make a search using my user name for more,

I hope you can glue the pieces together with this info, to use Masm with C++

Posted on 2002-03-09 09:35:07 by andy981
thx very much:grin:
looks very promising, i'll try it that way

andy, what do all those options mean?
like /Z and stuff
Posted on 2002-03-09 10:06:25 by 08/15
it works now, thanks again.

one question remains: how do i let an ASM-proc return a value?

Posted on 2002-03-10 09:06:28 by 08/15
I think the return value should be in eax.
So you could try to just move it to eax
Posted on 2002-03-10 10:13:53 by ante