flat assembler
Message board for the users of flat assembler.

Index > Heap > FASM vs. NASM

Goto page 1, 2, 3  Next
Author
Thread Post new topic Reply to topic
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
[this discussion is split from here ]

Quote:

I've been using NASM up till now and I am looking at whether FASM is better or not.


NASM is darn good, and it supports more output formats (e.g. OBJ, AOUT, RDF), plus it's more portable (written in ANSI C), but ...

FASM does run on 9 different OSes, has three IDEs w/ itself built-in (FASMW, Fresh, FASMD), can assemble itself, and doesn't need a linker by default. Plus, FASM has had x86-64 support for a while (and NASM has only slowly started attempting such). Of course, macros are confusing as *@%@^ but very powerful if you can wrap your head around 'em.
Post 17 Jul 2007, 19:18
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
my view about NASM vs. FASM:

NASM is more standard tool, that is intended to be part of toolchain. It can take many settings for code from command line. FASM is intended to be used mostly as separate tool. You cannot specify anything on command line to alter contents of resulting file. And FASM can produce executable directly.

FASM macrosystem is less "systematic" than NASMs, but way more powerful. And i think those FASM macros which are on same level with NASM macros are quite understandable. FASM and NASM are both lowlevel, but FASM has more powerful macrosystem that allows it to create your own customized highlevel assembler from it. Another thing is that creating all those macros is very lengthy process, so if you really want high-level assembler, it is better to use some more standardized one.

NASM is written in C, FASM is written in assembly. This gives FASM bad practical disadvantage over NASM.

As for syntactical abilities (except already discussed preprocessor), FASM's assembling capabilities are superior to NASM, and only slightly more complicated.

As conclussion, i think best thing for FASM would be to make fork of it in C, retaining most of FASM's advantages, but making it more a production tool than a pet project. FASM would so retain almost all it's advantages, and also it will get many of advantages that NASM has over it.

By the way, don't even consider NASM in current state: There is YASM, which is AFAIK superior to NASM in every way i can think of, maybe except some history.
Post 17 Jul 2007, 21:09
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
MichaelH



Joined: 03 May 2005
Posts: 402
MichaelH
Quote:

As conclusion, i think best thing for FASM would be to make fork of it in C



Seriously vid, you really need to stay away from drugs and alcohol ...... look what they are doing to your brain Smile
Post 17 Jul 2007, 22:24
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Quote:

Seriously vid, you really need to stay away from drugs and alcohol

What's wrong with that idea? fasm already can do cross platform compiling but still is unable to do cross arquitecture compiling because fasm can run only on x86. I know that is not very common to use a, say, MIPS arquitecture to compile x86 code but NASM can do that while fasm can't.
Post 17 Jul 2007, 22:34
View user's profile Send private message Reply with quote
MichaelH



Joined: 03 May 2005
Posts: 402
MichaelH
MIPS arquitecture ??? My computer clock tells me it's 2007 yet someone is talking about MIPS like it's back in the early 1990's Wink

Perhaps you're right though LocoDelAssembly, maybe I should see the light. When I buy my new MIPS system, cough, what version of windows vista should I install on it?


Come on LocoDelAssembly admit it, what you really feel like doing is like President bush telling his people "the reason we're entering Iraq is weapons of mass destruction" ..... or maybe even like a scientist wanting money to fund his laboratory by stating global warming nonsense (hows that snow at your place?), what you really want to say is that tried and trusted statement someone always states in pointless C verse ASM debate, quote -

Quote:

Any good C compiler today will produce code that out performs assembly


Sigh Sad


It truly is a sad state of affairs when the three main posters in an assembly forum, you vid and fodder ( affectionately known by tom as fudder ) all rant C nonsense Sad
Post 18 Jul 2007, 04:04
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
vid wrote:

NASM is written in C, FASM is written in assembly. This gives FASM bad practical disadvantage over NASM


No. I disagree. I like fasm for it being written in asm Smile

_________________
Attitude!
Post 18 Jul 2007, 05:37
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
Hey rugxulo i was also confused at which is better fasm or nasm.
But fasm is in asm, for love of asm, by the asm fan, for the asm fans.
It makes sense Exclamation
Post 18 Jul 2007, 05:41
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
MichaelH wrote:

Any good C compiler today will produce code that out performs assembly

Sigh Sad

It truly is a sad state of affairs when the three main posters in an assembly forum, you vid and fodder ( affectionately known by tom as fudder ) all rant C nonsense Sad


Any language that can do your work at hand is good!
But asm is always the best!

_________________
Attitude!
Post 18 Jul 2007, 05:44
View user's profile Send private message Reply with quote
MichaelH



Joined: 03 May 2005
Posts: 402
MichaelH
Quote:

Any language that can do your work at hand is good!


Maybe that's true??? but IMO, this is an assembler forum not a C forum! There's stacks of C programming resources out there and few assembler resources.

I would normally expect an admin of a assembler forum to not make statements like "fasm not being a production tool but rather a pet project". These statements add to the belief that somehow assembly is substandard to HLL's which is complete nonsense.
Fasm is a production tool even if our illustrious leader vid believes otherwise!
Post 18 Jul 2007, 05:59
View user's profile Send private message Reply with quote
vador



Joined: 12 Nov 2006
Posts: 68
Location: Madagascar
vador
If we don't want FASM to be considered a "pet project", just start writing real-world useful applications, not just examples or FASM IDE's.
How about creating game projects, calculators, agenda's address books, or even a simple spreadsheet?
Post 18 Jul 2007, 07:16
View user's profile Send private message Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
I agree with both vador & MichaelH.
Post 18 Jul 2007, 08:25
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
m wrote:

vid wrote:
NASM is written in C, FASM is written in assembly. This gives FASM bad practical disadvantage over NASM

No. I disagree. I like fasm for it being written in asm

You can disagree, but i wasn't talking about subjective likeness. I was talking about PRACTICAL disadvantage, and there surely is one.

MichaelH wrote:
MIPS arquitecture ??? My computer clock tells me it's 2007 yet someone is talking about MIPS like it's back in the early 1990's

Yeah, my computer clock tells me too that it's 2007, so i wonder where is the version for amd64 architecture.

Please reread my post. What I wrote is that FASM is good at being "how we like it", but that is not very a production tool. And that's a pity, because available production tools lack many great features of FASM, but FASM is not an option too. So I told that I would like to have fork of FASM written in way that it can be used for real-world application, where you need to rely your compiler will work after 10 years on different processors, and need to manage big mixed project using 3-4 languages by single makefile.
Post 18 Jul 2007, 08:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
m



Joined: 28 Dec 2006
Posts: 304
Location: in
m
vid wrote:
So I told that I would like to have fork of FASM written in way that it can be used for real-world application, where you need to rely your compiler will work after 10 years on different processors, and need to manage big mixed project using 3-4 languages by single makefile.


Well compiler will be reliable after 10yrs, but, programs may not.

_________________
Attitude!
Post 18 Jul 2007, 08:44
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
Well compiler will be reliable after 10yrs, but, programs may not.

Right, but at least people will have some chance to ADD support for new processors, keeping rest of compiler code. When written in assembly, complete codebase has to be rewritten to just make it run on different processor. This is the practical disadvantage i was talking about.
Post 18 Jul 2007, 09:15
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
pjd



Joined: 15 Jul 2007
Posts: 47
pjd
vid wrote:
Right, but at least people will have some chance to ADD support for new processors, keeping rest of compiler code. When written in assembly, complete codebase has to be rewritten to just make it run on different processor. This is the practical disadvantage i was talking about.


should the x86/x86-64 platforms become out of date (say replaced by the IA64 Intel Itanium - not likely but possible) Fasm would not only need a rewrite to run on the new processor but also to compile usable programs. any x86 assembler would need a rewrite (MASM, TASM, NASM, YASM, FASM, the lot). Also the programs using them would need complete rewrites to use the new processor. Just to outline the differences the IA-64 is marketed as an advanced processor by using its 128 General purpose registers to hold local variables (like in C) instead of sticking them on the stack.
Post 18 Jul 2007, 09:45
View user's profile Send private message Reply with quote
MichaelH



Joined: 03 May 2005
Posts: 402
MichaelH
Quote:

What I wrote is that FASM is good at being "how we like it", but that is not very a production tool.


Yes it is Razz

I use PEBrowseDbg.exe on windows and althought the decompiled code's syntax is slightly different than fasm syntax, it always decompiles the code as it was written. So if you can show me where fasm does not assembly properly (yes I know about the current bugs) then maybe I'll agree with you but in the mean time Razz Razz Razz Twisted Evil
Post 18 Jul 2007, 10:29
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
So if you can show me where fasm does not assembly properly (yes I know about the current bugs) then maybe I'll agree with you

are you suggesting that proper assembling is only requirement for production tool?

Quote:
any x86 assembler would need a rewrite (MASM, TASM, NASM, YASM, FASM, the lot)

No. They would only require to rewrite part which generates code. Or even better, they will only require ADDING support for new processor, and support for older processor can remain. FASM would have to be rewritten completely, not just X86_64.INC.
Post 18 Jul 2007, 10:50
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
tom tobias



Joined: 09 Sep 2003
Posts: 1320
Location: usa
tom tobias
vid wrote:
...FASM would have to be rewritten completely,
Then, in such a circumstance, let us hope the effort commences with the documentation FIRST, and the code last.
Post 18 Jul 2007, 11:13
View user's profile Send private message Reply with quote
MichaelH



Joined: 03 May 2005
Posts: 402
MichaelH
Quote:

are you suggesting that proper assembling is only requirement for production tool?


That's always been the true power of fasm and what makes it the best tool ever!!!. You write a line of code and that's what is produced in the binary. I'm saddened for you that over the years here you've forgotten that and moved to HLL's like C that do not produce exactly what you write. Come back from the dark side vid Smile


Documentation tom? ..... can you please speak english so we can all understand Wink
Post 18 Jul 2007, 12:18
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
Quote:
I'm saddened for you that over the years here you've forgotten that and moved to HLL's like C that do not produce exactly what you write.
Actually, i have learn C well enough, so now it produces code just like i want. Doing extra work to get same result isn't a very good idea.

Usually in bigger project, most of code is just calls to other procedures. This is almost as fast when written in C, as in ASM, but takes considerably longer in ASM, and isn't portable. Of course, if someone wants to write it in ASM, it is fine. I don't like writing same routine stuff all over, when i know computer can do it for me. This is exactly same idea as with macros, just pushed little further.

Don't you use macros? You must have lot of fun using "db"s to declare import section "exactly as you write it".

Really MichaelH... I suggest you to learn C as good as you know assembly, try to code something bigger in both of them, and THEN you have enough experiences judge and compare them.
Post 18 Jul 2007, 13:35
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2, 3  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.