Author Topic: do you have to have a linker for nasm , if so witch one do you sugest  (Read 7024 times)

Offline flyhigh427

  • Jr. Member
  • *
  • Posts: 60
hey what does elf32 do ?
and what linker is this?
; nasm -f elf32 printhex.asm
; ld -o printhex printhex.o
thanks

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
"-f elf32" tells Nasm to create a linkable object file ("ELF" = "Executable and Linkable Format") - it is for Linux, and won't work for you - I probably shouldn't have shown you that...

"ld" is the linker used by the GNU toolchain. There is a version of it for Windows (MinGW/Cygwin), but may not be what you want. (I don't think it'll do 16-bit files?)

It is possible to create executable files - even Windows executables (PE - Portable Executable) - with just Nasm... but probably easier to let the linker do its job...

Nasm will create .com files without a linker. If they're working for you, that's probably the easiest place to start. When your code (plus data) exceeds 64k (a lot of code!), or you need to link multiple modules together, then you'll need a linker. I used to use Alink with some success... there are others, possibly "better"(?)...

Best,
Frank