C & Asm
Posted: Mon May 12, 2003 1:20 am
I have C and asm files which I want to link them. I compiled C files with tcc and asm files with tasm. But I wonder how the linker(tlink) understands the entry point of code.
Here is my makefile:
pmode.exe: pmodeasm.obj pmodec.obj
tlink /c /x /3 c:\tc\lib\c0s pmodeasm pmodec, pmode,, c:\tc\lib\cs
pmodeasm.obj: pmodeasm.asm
tasm /m2 /mx /zi /o pmodeasm.asm
pmodec.obj: pmode.h pmodec.c
tcc /c pmodec.c
And tlink gives this error:
Error: Undefined symbol _main in module c0.ASM
But my main code is in asm part and I use C file to call some function from it. how can I tell the linker that the entry point of code is in Asm file?
Here is my makefile:
pmode.exe: pmodeasm.obj pmodec.obj
tlink /c /x /3 c:\tc\lib\c0s pmodeasm pmodec, pmode,, c:\tc\lib\cs
pmodeasm.obj: pmodeasm.asm
tasm /m2 /mx /zi /o pmodeasm.asm
pmodec.obj: pmode.h pmodec.c
tcc /c pmodec.c
And tlink gives this error:
Error: Undefined symbol _main in module c0.ASM
But my main code is in asm part and I use C file to call some function from it. how can I tell the linker that the entry point of code is in Asm file?