I know asking this is quite stupid, as it has been asked before, but because this board has assembly programmers with experience from all the assemblers, I thought it was a good idea, well...

The most important question is: "Which one optimizes better code?"..  I mean, jumps, etc..  I heard both assemblers can let you specify the number of passes, but which one does optimize better (for the same number of passes)?

If they optimize the same, which one has more (useful) features? I have nothing against any of these assemblers.. both are great, and FREE (and even open-source). The last question is which one is more portable, but that's not really a big concern.

PS: I think I read somewhere that FASM has a limit (in filesize/memory, don't know exactly) which NASM doesn't...  is that false, because I know FASM is as powerful as NASM.


Sorry if I haven't posted in the right forum, but I didn't know where actually.

Thanks in advance  :D
Posted on 2005-12-07 14:20:07 by The Grey Beast
When it comes down to it (minus the small differences), NASM was written in C (portable with the standard C Library) and FASM was written in assembly language (not quite portable, but can assemble itself which is good for OS Dev). YASM is slowly replacing NASM as well. Further than that, it really depends on which one you'd rather use as a personal preference (i.e. Coke or Pepsi, Intel or AMD, nVidia or ATI, etc...)

If you are really discontent with any of the choices and are bored like me... make your own :P
Posted on 2005-12-07 16:12:55 by SpooK
FASM does multiple passes, so you will always get smallest possible code. It has definitely more features than NASM, mainly because it is still developed by its original author, while NASM creators left the project.
FASM has no memory limit, if you get "out of memory" error then you can manually increase amount of memory used by compiler.
About portability, it can be easily ported to any x86 based platform. Currently it is available for DOS, Windows, Linux, and Unix (actually Unix version can work on all platforms that "support ELF object format and C library").
Posted on 2005-12-07 16:59:04 by decard
One disadvantage of FASM I just read yesterday but forgot.  Either listings or cross reference?  I'm sure someone knows.
Posted on 2005-12-07 17:06:58 by drhowarddrfine
My 0.2 cents ;) FASM is better than NASM in virtually every aspect, the only drawback I see is I find it's sources to be rather messy and hard to follow. The NASM sources, being written in C amongst other reasons, are much easier to mantain and modify for your own purposes.

So if you're just going to use it, choose FASM. If you're going to make changes or learn from the sources, choose NASM. :)

HLA is also a very good choice for both purposes, if you can cope with it's bizarre syntax (but that's entirely a matter of personal taste).
Posted on 2005-12-07 19:08:09 by QvasiModo
I vote for Fasm
Posted on 2005-12-08 00:52:04 by Vortex
It seems they both optimize well. Thanks for the tips  :D


FASM does multiple passes, so you will always get smallest possible code. It has definitely more features than NASM, mainly because it is still developed by its original author, while NASM creators left the project.
FASM has no memory limit, if you get "out of memory" error then you can manually increase amount of memory used by compiler.


That's cool..  I dunno why someone told me NASM has a better preprocessor than FASM (even though FASM has other nice features). I think he was wrong, so I think I'll stick with FASM.


If you're going to make changes or learn from the sources, choose NASM. :)


I may still use another assembler, and learn from the NASM source, even though I may not use NASM :mrgreen: why not?


Thanks again for the tips :)
Posted on 2005-12-08 13:22:59 by The Grey Beast
Fasm's preprocessor is pretty powerful..... FASM IS THE BEST!
Posted on 2005-12-08 18:06:56 by shism2
...the only drawback I see is I find it's sources to be rather messy and hard to follow.

The sources aren't messy. The style is old-fashioned pure assembly and not C-like. Thus you need first to get comfortable with it, but once you get into, you will find it is fery efficient and rather easy to modify. Internal structures and inner workings are also documented by its author.
Posted on 2005-12-09 06:58:25 by pelaillo

I may still use another assembler, and learn from the NASM source, even though I may not use NASM :mrgreen: why not?


That's what I do too :mrgreen:


The sources aren't messy. The style is old-fashioned pure assembly and not C-like. Thus you need first to get comfortable with it, but once you get into, you will find it is fery efficient and rather easy to modify. Internal structures and inner workings are also documented by its author.


You're right, for someone who's used to that kind of coding it's fine, but I prefer the MASM style in assembler (nesting, high level macros, etc.). :)
Posted on 2005-12-09 10:31:25 by QvasiModo
You're right, for someone who's used to that kind of coding it's fine, but I prefer the MASM style in assembler (nesting, high level macros, etc.). Smile

HLL constructs are possible in fasm since a few months (due to improvements in preprocessor that were made then). And you can customize them, add your own... whatever you want  :)
Posted on 2005-12-09 11:13:11 by decard
I meant in the FASM sources, personally I also use FASM for some coding ;)
Posted on 2005-12-09 11:29:33 by QvasiModo
How can FASM produce .obj files (and then using a linker to create apps)? IIRC NASM has some extern directives, or not? I have a linker, but don't know how to compile .obj in FASM (and possibly create header/include files?)

Anyway, anyone knows a (good) open-source linker?  GoLink 64 is pretty good, but I don't think it's open-source, so anyone know any linkers? thanks again.
Posted on 2005-12-12 11:00:23 by The Grey Beast
The Grey Beast,

You can use Polink.exe, a linker compatible with MS Link. It comes with the Pelles C package.
Also, you may have a look at ld.exe coming with the MinGW package.
Posted on 2005-12-12 12:11:13 by Vortex
Vortex has also prepared a number of examples and a tool to ease the process of linking objs:
Linking examples: http://board.flatassembler.net/topic.php?t=4135
External function scanner for Fasm: http://board.flatassembler.net/topic.php?t=72

Look also Alink: an open source linker with artistic license:

http://alink.sourceforge.net/download.html
Posted on 2005-12-12 12:17:15 by pelaillo
Too bad alink hasn't been updated for... 5 years?

It's opensource and rather messy, but it's easier to dig into than GNU LD. Dunno if there's much point to it, though, unless you really want an opensource linker - polink, golink etc are free and capable :)
Posted on 2005-12-12 12:28:42 by f0dder
Thanks
Posted on 2005-12-12 13:03:16 by The Grey Beast