NASM - The Netwide Assembler

NASM Forum => Programming with NASM => Topic started by: ittechbay on August 21, 2013, 07:28:11 AM

Title: Can not link with Borland C++ linker(ilink32) ?
Post 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?
Title: Re: Can not link with Borland C++ linker(ilink32) ?
Post by: encryptor256 on August 21, 2013, 07:56:11 AM
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:

Code: [Select]
use32
[section .text use32]
..start:
move ax,1
ret
Title: Re: Can not link with Borland C++ linker(ilink32) ?
Post by: Frank Kotler on August 21, 2013, 08:56:25 AM
Code: [Select]
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