I am trying to use Masm in a C proggie but I can't convince the C proggie to use its main function.
include \masm32\include\masm32rt.inc
MasmProggie PROTO C :SDWORD, :SDWORD ; exports euclid to C
.code
MasmProggie proc C x:SDWORD, y:SDWORD
print "This is assembler", 13, 10
mov eax, x
mul y
ret ; return value already in eax
MasmProggie endp
end MasmProggie
#include <stdio.h>
#include <stdlib.h>
int MasmProggie(int, int);
int main(int argc, char* argv[])
{
int i=10; //just for fun
printf("Arg count=%d\n", argc);
printf("The product of argct and 10: %d\n", MasmProggie(i, argc));
return 0;
}
Assembles, compiles and links just fine, the C code is inside the exe but I see only the assembler output, i.e. "This is assembler".
How do I instruct cl, ml and link what is the entry point??
commandlines:
"%ProgramFiles%\Microsoft Visual Studio 9.0\VC\bin\cl.exe" /Zl /Fa C_wants_Asm.obj C_calls_Asm.cpp
\masm32\bin\link C_wants_Asm.obj C_calls_Asm.obj /out:C2A.exe
echo LINKED ##
echo ----------------
c_calls_asm.exe 123 456 789 abc
echo ----------------