| | |
Turbo C Fixup Error
![]() |
•
•
Join Date: Apr 2008
Posts: 22
Reputation:
Solved Threads: 0
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:
And here is my Turbo C code:
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?
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:
ASM Syntax (Toggle Plain Text)
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:
C Syntax (Toggle Plain Text)
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?
•
•
Join Date: Jun 2008
Posts: 1
Reputation:
Solved Threads: 0
Seems to be a common problem, only explained in some usenet news threads.
You don't seem to have any segments declared in your ASM code.
Try putting this just above your assembly function definition:
In addition, I'd suggest putting the following above your single variable declaration:
For a more thorough discussion, search "google groups" (USENET news, really) with the following query:
nasm "Fixup overflow" borland
The thread I'm referring to has the following subject:
Help linking a (trivial) NASM object file (.obj) with Borland C++ 3.0
Nice to know that others are still playing with Borland C for DOS + NASM, just like I do :-))
You don't seem to have any segments declared in your ASM code.
Try putting this just above your assembly function definition:
asm Syntax (Toggle Plain Text)
SEGMENT _TEXT PUBLIC CLASS=CODE USE16 ALIGN=16
In addition, I'd suggest putting the following above your single variable declaration:
asm Syntax (Toggle Plain Text)
SEGMENT data
For a more thorough discussion, search "google groups" (USENET news, really) with the following query:
nasm "Fixup overflow" borland
The thread I'm referring to has the following subject:
Help linking a (trivial) NASM object file (.obj) with Borland C++ 3.0
Nice to know that others are still playing with Borland C for DOS + NASM, just like I do :-))
![]() |
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Copy object to Clipboard in Report Viewer
- Next Thread: Mathematical Logic Question
| Thread Tools | Search this Thread |





