What are the main differences between the following assemblers?

FASM

MASM

NASM

TASM

There's bound to be others that I am forgetting in my post-five hour+ HLA Adventure debugging session, but more Dr. Pepper will surely cure that! :)

It is dark. There's a str.index grue. You're likely to be eaten by a str.index grue. :)

Paul
Posted on 2005-06-05 03:29:47 by Paul Panks
I'd say their license, their syntax and their bugs ;)
Posted on 2005-06-05 06:31:08 by JimmyClif
The level of support is also different. For instance, you can speak directly (and report bugs and give comments etc) to the author of FASM and GoASM but not to the author of TASM.

Posted on 2005-06-05 07:30:48 by roticv
And the power of their macros.
Posted on 2005-06-05 07:31:32 by Ultrano
invoke
Posted on 2005-06-05 20:41:18 by allyesno
NASM is obsolete, FASM can do all NASM does and more (and it's multipass). They're both portable and can produce full programs as well as raw binaries.

MASM is great and there are lots of code examples on the Net, but you can't make raw binaries with it easily, and it's license forbids you to write Linux programs too. Also i'ts one-pass only.

HLA is very good, but you really have to enjoy it's bizarre syntax to be able to use it! ;)

TASM is probably the best, but no longer supported by Borland (and not free anyway). :(

GoAsm is also very good, the only thing I don't like about it is it's more primitive "invoke" support (compared to MASM). However there are advantages, like Unicode handling and no need for import libraries.

Those are the only assemblers I tried. :)
Posted on 2005-06-06 15:25:37 by QvasiModo

TASM is probably the best

Why? I've seen many express this kind of nostalgia, but never really understood it...

Posted on 2005-06-06 15:29:50 by f0dder
For me, two different syntaxes and fast builds (in that order). To be honest I haven't done much with it (we have a copy here at the Univ), I'm basing my opinion in comments of others mostly...
Posted on 2005-06-06 16:21:22 by QvasiModo
I am using TASM everyday

For me the most important TASM feature is the tremendouse build speed, this helps a lot on huge projects
then I do care for the slightly better syntax of PROCEDURES...
and theoretically the IDEAL syntax is more natural (but I do not use it for now)

And there are new TASM versions included with C++ Builder from Borland...
but it is true that TASM is not very good for starters and it has some very strange bugs.

Posted on 2005-06-07 12:55:07 by BogdanOntanu
hey,

and dont forget that TASM have native OOP support  8)

ancev
Posted on 2005-06-07 14:50:06 by ancev

NASM is obsolete, FASM can do all NASM does and more (and it's multipass). They're both portable and can produce full programs as well as raw binaries.

MASM is great and there are lots of code examples on the Net, but you can't make raw binaries with it easily, and it's license forbids you to write Linux programs too. Also i'ts one-pass only.


One-pass only? I'd say MASM is also multi-pass:


Unlike version 5.1, MASM 6.1 does most of its work on its first pass, then performs as many subsequent passes as necessary.
Posted on 2005-06-08 07:31:27 by MazeGen
Then why do you have to declare data labels before using them? :shock: Strange behavior from a multipass assembler... IMHO if it does more than one pass then it's got design flaws. :|
Posted on 2005-06-08 15:19:50 by QvasiModo
Then why do you have to declare data labels before using them? :shock: Strange behavior from a multipass assembler... IMHO if it does more than one pass then it's got design flaws.

isn't that a bug only in invoke?
Posted on 2005-06-08 15:43:36 by JimG

Strange behavior from a multipass assembler...

It needs prototypes to be able to do parameter/type checking.


IMHO if it does more than one pass then it's got design flaws.

You need multi-pass if you want to do jump size optimization.
Posted on 2005-06-08 18:14:09 by f0dder
With thanks to Randy Hyde for the terminology, modern compilers/assemblers tend to be multiphase rather than the older concept of multipass and it tends to be done by using data structures like hash table and trees to store the source in a particular format. A genuine one pass assembler is not something that you would want to write code with as it would be very far removed from anything you may have seen.
Posted on 2005-06-08 18:38:19 by hutch--
I think that just about every assembler would be multiphase - that is, breaking the assembly stage into various passes. The pass terminology still applies, though - you need an extra pass when you do certain size optimizations.
Posted on 2005-06-08 18:41:43 by f0dder
There is little doubt that a single pass (in the old fashioned sense) is possible but it would be a very difficult tool to use, somewhere between the old DOS debug and a hex editor but to do anything even vaguely modern in terms of capacity, you have a preprocessor stage for macros and the like complete with error checking for that capacity, then any intrinsic syntax if the assembler supports any of the pseudo high level forms, then mnemonic crunching for opcode production the jump length optimisation with error checking all the way through so the data from the source is worked on many times to produce the binary code for an object module.

The preprocessor phase involves text expansion and this generally needs to be done before the source is loaded into the data structures for further processing but the subsequent operations can generally be done in the context of how they are stored in memory.

The old multiPASS terminology is a left over from the DOS days where memory often played a part in how a compiler/assembler was layed out to handle source that could not be handled and often involved temporary disk file to handle the size but with 32 bit addressing range this was rarely ever necessary as far more memory was available for internal data structures. The in memory aspect is what allows the design to be multiPHASE instead of the older disk based technology but its also fair to say that compiler/assembler design has come a long way since the DOS days so it is as much a design change as a capacity change.
Posted on 2005-06-09 00:35:51 by hutch--
Interesting, is it the official terminology? If yes, I should perhaps call flat assembler the multiphase one, since what I called "passes" were always performed not on the original source, but on the internal fasm's code (where, for example, there are no longer symbol names, but only pointers to the entries in symbol table, etc.).
Posted on 2005-06-09 08:03:50 by Tomasz Grysztar
Tomasz,

I got caught with the same terminology but if I have it right, your assembler is a much later design and a lot faster than the old multipass ones of years ago. I personally call runs through data "passes" but from the info Randy posted the term was understood in a different way years ago. This much, the preprocessor phase is probably closer to a pass than a phase.
Posted on 2005-06-09 11:20:06 by hutch--
Privalov, I don't know what the official terminology is - I don't have any textbooks on compiler design (yet).

I think it would be logical to use the term "phase" (or "stage" or "step" or something else if you prefer) about the logical steps the assembler takes (loading file, preprocessing, code generation, output). At least one of your phases has multiple passes (near call optimizations).
Posted on 2005-06-10 09:27:40 by f0dder