Hi,
Im writing a program in Turbo C but i also want to use some assembly functions, for this im using nasm.
This is my assembly code:
BITS 16
GLOBAL _Add4
n_Add4 equ 4
_Add4:
push bp
mov bp,sp
mov ax, [bp + n_Add4]
add ax, 4
mov sp,bp
pop bp
ret
And here is my Turbo C code:
extern int Add4(int);
void main() {
int n;
n = Add4(77);
}
Im linking this way:
nasm -o asmmodule.obj -f obj asmmodule.asm
tcc -mt -c cmodule.c
tlink cmodule.obj asmmodule.obj
But tlink gives me the following error:
Fixup overflow in module CMODULE.C at _TEXT:000B, target = _ADD4
Anyone knows how to fix this?