NASM - The Netwide Assembler
NASM Forum => Using NASM => Topic started by: nobody on October 21, 2005, 12:09:28 PM
-
There is a small appliction
;exetest2.asm
;build by
; nasm -f coff exetest2.asm
; gcc -o exetest2.exe exetest2.o
section .data
msg db 'Hello!',13,10,'$'
section .text
global _main
_main:
mov dx, msg
mov ah, 9
int 21h
ret
;end of exetest2.asm
When I build it , nasm will show following error message:
"COFF format does not support non-32-bit relocations"
Could you tell me how to solve this problem?
Thanks!
-
mov edx, msg
Despite the fact that you can use dos interrupts, COFF is a 32-bit format...
Best,
Frank
-
Could you give me more details?
How to use the 16bit address in the 32bit?
Thanks!
-
COFF/x86 does support 16-bit relocations (via
type 0001h/0002h instead of 0006h/0014h).
However, NASM's COFF output format lacks sup-
port for them.
You could try another format, e.g. OBJ.
Fwiw, recent 32-bit versions of MS LINK won't
let you link object files that contain 16-bit
relocations. (However, they will let you link
16- and 32-bit code, as long as they only use
32-bit relocations.)