NASM - The Netwide Assembler
NASM Forum => Programming with NASM => Topic started by: ittechbay on August 21, 2013, 07:28:11 AM
-
my code is:
; file name: test.asm
USE32
[SECTION .text]
..start:
move ax,1
I use nasm to compile: nasm -f obj test.asm
when I use ilink32:
ilink32 test.obj
Fatal: Unsupported 16-bit segment <s> in modle test.asm
how should I use nasm+ilink32 to compile asm?
-
Hi!
Maybe you need to give him more parameters, to specify expected result.
For example i use linker ALINK, i feed him like this:
"alink -c -oPE -subsys windows myfile.obj"
Or maybe like this for segment: "[SECTION .text use32]", might help.
Its all about experimenting. :)
----------------------------------
EDIT: Maybe it cant find end of the .text segment, maybe it needs "ret" at the end of your code, like this:
use32
[section .text use32]
..start:
move ax,1
ret
-
section .text use32 class=CODE
... as encryptor256 suggests... "use32" at the top of the file (alias for "bits 32") does not make the individual sections 32-bit.
Nasm's 32-bit extensions to "-f obj" are kinda half-baked. Best bet is to assemble with "-f win32" and convert to OMF using Agner Fog's "objconv" if you want to keep Borland's tools happy.
Best,
Frank