flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Main > FASM and NASM -- differences

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



Joined: 23 Jan 2017
Posts: 35
FASM and NASM -- differences
What are the differences between Nasm and Fasm except the fact that Fasm is faster and itself if written in assembly?
What about the instruction set?
And also which one is more popular?
Why do you personally use FASM? or NASM.
Post 24 Jan 2017, 04:47
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14673
Location: Origae-6
Re: FASM and NASM -- differences

jorido wrote:
What are the differences between Nasm and Fasm except the fact that Fasm is faster and itself if written in assembly?

The macros are different. And a few other things like not needing an external linker for self contained projects.

jorido wrote:
What about the instruction set?

NASM seems to be updated more quickly when new instructions are introduced.

jorido wrote:
And also which one is more popular?

Don't know and don't care.

jorido wrote:
Why do you personally use FASM? or NASM.

Because it is not an ugly bloated piece of C that requires a separate C compiler and a linker to compile. Plus the author is very responsive to questions and problems.


Last edited by revolution on 24 Jan 2017, 06:34; edited 1 time in total
Post 24 Jan 2017, 05:00
View user's profile Send private message Visit poster's website Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 254
Re: FASM and NASM -- differences

jorido wrote:
And also which one is more popular?

From what I can tell, NASM seems to get more attention among FOSS people; the Ubuntu package repositories have packages for NASM but not for FASM, for instance. I'm not entirely sure why it's more popular though.

jorido wrote:
Why do you personally use FASM? or NASM.

I like the 'same source, same output' principle. http://flatassembler.net/docs.php?article=design It's a nice departure from the sea of command line switches that you would need to swim in with the likes of NASM and GCC.
Post 24 Jan 2017, 06:29
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14673
Location: Origae-6
Re: FASM and NASM -- differences

Trinitek wrote:
From what I can tell, NASM seems to get more attention among FOSS people; the Ubuntu package repositories have packages for NASM but not for FASM, for instance. I'm not entirely sure why it's more popular though.

Maybe because it uses the C compiler so naturally it is "easier" for them. Wink
Post 24 Jan 2017, 06:33
View user's profile Send private message Visit poster's website Reply with quote
jorido



Joined: 23 Jan 2017
Posts: 35
On stackoverlow NASM is also more popular by the number of questions.
Post 24 Jan 2017, 06:47
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 471
NASM and even MASM have been deeply cultured in colleges for long, so that explains their popularity. They receive continuous support from academia. FASM is missing that entry point despite of it having a more powerful macro engine and cleaner design. So in the future, expect FASM to be a 'specialist' assembler intended to be used by more experienced programmers. Unless TG is willing to invest more in educational part of FASM, it will stay that way for good.

Just being honest.
Post 24 Jan 2017, 13:21
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 471

jorido wrote:
On stackoverlow NASM is also more popular by the number of questions.

That mostly from college students doing their homework. You don't get that kind of questions for FASM that often from Stack Overflow.

@Trinitek FASM isn't a GNU/GPL-related licence. So it can not be included in any Linux repositories for distributions just like people do with NASM.
Post 24 Jan 2017, 13:25
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1185
Location: Athens
No one mentions that FASM board has over 110000 posts (excluding the 50000 heap messages where you may also find inside assembly related stuff). No need to search stackoverflow for an answer here.

jorido hi,
read some related posts: https://board.flatassembler.net/topic.php?p=165866#165866
Post 24 Jan 2017, 13:34
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 471
Re: FASM and NASM -- differences

jorido wrote:
Why do you personally use FASM? or NASM.



What makes the obvious differences are the culture of people around it and the approach to the problem at hand. Syntax makes little differences (not the macro though. Macro makes huge differences). 'Culture' can be seen from their respective discussion boards.

From my observations;

1. MASM 'culture' - high-level, Windows-centric and optimization.
2. NASM 'culture' - beginners Hello World, Linux, C
3. FASM culture - macro, compiler writing, OS development.

That doesn't mean that a 'culture' is not capable of what the others can do. It's just that they have this recognizable tendencies. In all 3 cultures, in-fighting among the peasants are quite common. HAHAHA Very Happy
Post 24 Jan 2017, 13:46
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 471

Picnic wrote:
No one mentions that FASM board has over 110000 posts (excluding the 50000 heap messages where you may also find inside assembly related stuff). No need to search stackoverflow for an answer here.

jorido hi,
read some related posts: https://board.flatassembler.net/topic.php?p=165866#165866



I hate stackoverflow. One fine day, I gave a funny response to a guy in Networking section about his problems with some 'walls' and 'noise'. I recommended to him to use "whispering" instead to solve it. I got 10 downvotes for that reply. I got another 3 downvotes for explaining in my next post that it was a joke. I quit stackoverflow right away Razz
Post 24 Jan 2017, 14:06
View user's profile Send private message Reply with quote
Trinitek



Joined: 06 Nov 2011
Posts: 254

system error wrote:
@Trinitek FASM isn't a GNU/GPL-related licence. So it can not be included in any Linux repositories for distributions just like people do with NASM.

I don't see a clause in the FASM license that prevents its inclusion. Is it excluded out of principle of being GPL incompatible?
Post 24 Jan 2017, 16:11
View user's profile Send private message Reply with quote
Furs



Joined: 04 Mar 2016
Posts: 290
That's not true. YASM is included in repositories and some projects even require it for "asm optimizations" on Linux. And it has BSD license.

Anyway I couldn't care less about repositories, I prefer to get the app directly from the author's site (like FASM), unless the app I download needs a hellish dependency chain, that's the only thing package managers are good for.

FASM doesn't though. I'm kinda sick of so many libraries for every little thing creating so many dependencies (even when compiling open source stuff), especially because the idiot library developers in the Linux world just absolutely love to deprecate/break backward compatibility so many times. You'd think after ONE backward compatibility break they'd learn to design them future-proof, but nah, who cares of users, their stupid code needs to be "just perfect". (contrast that with the kernel which never breaks backward compatibility with userland code, and Linus is a fierce advocate of this, that's why I respect him so much -- it's a reason I use Wine for alot of apps on Linux and prefer them to native, lol, because Wine's interface being Win32 always has backwards compatibility, so only Wine has to be recompiled to support the "breaking compatibility system libraries", not all my fucking apps!)
Post 24 Jan 2017, 18:07
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1382
Location: Toronto, Canada
I wonder if NASM has an error messages for a type mismatch:

Code:

mov [esi + MyStructure.dwValue], al        ; Writing 8 bits into 32 bits
mov ecx, [esi + MyStructure.dbValue]       ; Reading 8 bits into 32 bits

... same for CMPetc. (ANY REG/MEM opcode)



Post 24 Jan 2017, 19:16
View user's profile Send private message Send e-mail Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 468
Location: Belarus
Re: FASM and NASM -- differences

system error wrote:

From my observations;

1. MASM 'culture' - high-level, Windows-centric and optimization.
2. NASM 'culture' - beginners Hello World, Linux, C
3. FASM culture - macro, compiler writing, OS development.



This is very true. I myself chose fasm when I started learning osdev because it was very friendly to plain binary output, what other assemblers lacked much; for its self-sufficiency and speed. Enjoyin fasm since then (although I never comprehended its rich macros and it's a shame)
Post 24 Jan 2017, 19:21
View user's profile Send private message Reply with quote
jorido



Joined: 23 Jan 2017
Posts: 35
How about macroses in FASM? There're so many of them and they're difficult. And they aren't related to knowledge of Assembly, whereas one programming in FASM has to learn them anyway. One can become better in Assembly by using marcoses by programming in NASM, but does that mean that he's really become better in Assembly in general? Without macroses?

I mean, macroses are like a framework: one can be good at creating software using a framework, but he only understands the process in a high level, with that framework, and not what's going on under the hood. Take away that framework and he's unable to do programming anymore.

I think In NASM the macro system is less powerful, much smaller and less complex and that's good. What do you think?
Post 25 Jan 2017, 09:07
View user's profile Send private message Reply with quote
zhak



Joined: 12 Apr 2005
Posts: 468
Location: Belarus

jorido wrote:
Take away that framework and he's unable to do programming anymore.


It is, but macros aren't framework. They're helpers to do routine things more quickly and conveniently.

For instance, you can do

Code:

myProc:
  push ebp
  mov ebpesp
  . . .
  mov espebp
  pop ebp
  ret



each time. But you can make it more convenient with a single-line macro.
A more useful example: struct macros. I cant' imagine life without structures


jorido wrote:

I think In NASM the macro system is less powerful, much smaller and less complex and that's good. What do you think?


No, it's not better. The more powerful and flexible macro engine is, the more you can do. You know, you can create such things as .iso or .fat32 images with fasm. With less powerful and smaller macros you would require third-party utils for this. Differrent sets of utils if you develop on multiple platforms, etc.

Macros are not framework. Nobody forces you to use macros if you don't want to, and you will still be able to accomplish what you want. It could just take a bit more effort and won't be that attractive (I myself use only struct macro and it's enough for me)
Post 25 Jan 2017, 09:21
View user's profile Send private message Reply with quote
jorido



Joined: 23 Jan 2017
Posts: 35
"like a framework".

yes, I don't have to use them, but I have to read code someone else has written using them and I have to read documentation with them.
Post 25 Jan 2017, 09:37
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 471
@jorido Macro in FASM doesn't really fit the definition of macros in NASM and / or MASM. FASM macros systems go beyond that. It can create something out of nothing. For example, FASMG is a macro systems totally independant of CPU/processors and can provide emulations to both hardware and software. This goes with the FASM culture I mentioned above - compiler writing, and add to it instruction emulations of other architecture (AVR, Java byte code, 8051 etc). FASM macro language is huge and expanding.
Post 25 Jan 2017, 11:46
View user's profile Send private message Reply with quote
system error



Joined: 01 Sep 2013
Posts: 471

Trinitek wrote:

system error wrote:
@Trinitek FASM isn't a GNU/GPL-related licence. So it can not be included in any Linux repositories for distributions just like people do with NASM.

I don't see a clause in the FASM license that prevents its inclusion. Is it excluded out of principle of being GPL incompatible?



Exposing FASM to GNU environment will allow people to create "forks". Forks and friends may not be healthy for FASM which is very strict in its design principles. I don't think any kind of "forks" can offer anything of value to both FASM and GNU community. FASM is non-POSIX anyway.

I don't know. I don't speak for TG. But I think that's a reason.
Post 25 Jan 2017, 12:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 14673
Location: Origae-6
Well assemblers are not popular in C-land. They only exist as a necessity to allow the C-compiler to generate binaries. Plus fasm doesn't support the "lovely" AT&T syntax, so many in C-land will reject it simply based upon that.

But, whatever, I don't care if C-land love it or hate it. That is their problem, not mine.
Post 25 Jan 2017, 12:20
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  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 cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.