FASM vs. NASM: What's the Difference?

Programming, for all ages and all languages.
User avatar
ClarionCoder51
Member
Member
Posts: 28
Joined: Sun Aug 16, 2009 11:52 am
Location: Georgia, USA

FASM vs. NASM: What's the Difference?

Post by ClarionCoder51 »

I've been hearing alot about NASM, lately. There's NASM this and NASM that and "Hey, I use NASM, too!". I ended up using FASM by chance, but I never really compared the two before. What's the difference?
"The n00b zone is for loading and unloading newbies only."
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: FASM vs. NASM: What's the Difference?

Post by f2 »

NASM is written in C and supports many object files (ELF, COFF, OMF, MACH-O, AOUT, etc).
FASM is written in assembly, generates ELF / COFF object files, and ELF / PE / MZ executables (NASM needs a linker for generating executables).
NASM and FASM have the same syntax, with some differences.

If you want make an OS in assembly language, FASM is the best choice. Otherwise, if you want make
an OS in C, you should use NASM.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by Combuster »

I've been reading your latest posts, and I couldn't help noticing that you ask a lot of things that are explained on the wiki, could be found by a forum or google search. And you give the overall impression that either you are lazy, or unable to understand (basic) things on your own.

OS development is hard. Do you have what it takes? because right now I'd say "no".
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by Dex »

Theres lots, but the main ones are, if you are a C programmer that will be moving your OS to C as soon as you can, go for nasm.
If your a 100% ASM Ccoder go with FASM, it was first coded to write OS's with and once you have some basic functions,
eg:
load from disk
write to disk
print
load programs.
It would take less than half a hour to port to your OS, as it was made to be portable.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: FASM vs. NASM: What's the Difference?

Post by f2 »

Dex wrote: if you are a C programmer that will be moving your OS to C as soon as you can, go for nasm.
Or try JWasm. It's written also in C and it's 100% compatible with MASM syntax.
Only MASM bugs aren't supported :D !
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
xvedejas
Member
Member
Posts: 168
Joined: Thu Jun 04, 2009 5:01 pm

Re: FASM vs. NASM: What's the Difference?

Post by xvedejas »

I use Fasm and C, they can work just fine together. I don't see anyreason why Nasm is better for working with C, contrary to what others have said. I really like Fasm's macro syntax, and it assembles fast, so it's my choice.
User avatar
f2
Member
Member
Posts: 311
Joined: Mon Jun 15, 2009 10:01 am
Location: France

Re: FASM vs. NASM: What's the Difference?

Post by f2 »

xvedejas wrote:I don't see anyreason why Nasm is better for working with C
Nasm is the most used with C, but IMHO it is not the best assembler.
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
User avatar
ClarionCoder51
Member
Member
Posts: 28
Joined: Sun Aug 16, 2009 11:52 am
Location: Georgia, USA

Re: FASM vs. NASM: What's the Difference?

Post by ClarionCoder51 »

Combuster wrote:I've been reading your latest posts, and I couldn't help noticing that you ask a lot of things that are explained on the wiki, could be found by a forum or google search. And you give the overall impression that either you are lazy, or unable to understand (basic) things on your own.

OS development is hard. Do you have what it takes? because right now I'd say "no".
Wow. I didn't know somebody could have such an attitude. True, I am lazy, but the wiki is filled with so much stuff that has nothing of actual use to me. As a matter of fact, I read the entire article on the soundblaster 16 and nowhere in that article did I find info on how to implement soundblaster 16.

I didn't become an OS Dev just to be trampled on by some moderator that likes to stalk me on the forum. You are the only member on this forum that I know that has not even bothered answer one of my maany innocent questions. Charge me with flaming if you want, but at least I know there's some descent people out there that can answer questions without insults. I don't think its even legal by the rules to be charged with flaming when you didn't even help.
"The n00b zone is for loading and unloading newbies only."
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: FASM vs. NASM: What's the Difference?

Post by Creature »

ClarionCoder51 wrote:As a matter of fact, I read the entire article on the soundblaster 16 and nowhere in that article did I find info on how to implement soundblaster 16.
Then you've not looked correctly, and you've made one of the following mistakes:
  • You've taken for granted that you are given information on implementing a specification, whilst specification just give guidelines how hardware works and the OS developer is responsible for the implementation.
  • You didn't read the other wiki pages in the sound category.
  • You forgot to check the additional URL's or links which direct you to the specifications.
  • You forgot that the wiki doesn't provide everything, but if it doesn't, Google can always help you. If that doesn't help, you can always come here.
Obviously there can be a discussion of whether a topic is valid, but I think this is something you could have figured out on your own by simply Googling or visiting the homepages of both assemblers.

PS: Combuster is not 'some moderator', he is 'no moderator' (since not long ago, I believe. Bad pun intented, insult not intended). But moderator or not, I think he has a point.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by pcmattman »

I read the entire article on the soundblaster 16 and nowhere in that article did I find info on how to implement soundblaster 16.
See that section at the bottom of that article there, the "Reference Links"? Try clicking on them, perhaps?
but the wiki is filled with so much stuff that has nothing of actual use to me
It has no actual use to you because you're lazy and looking for free code, or for someone else to do the hard work. If you can only depend on having code available or a tutorial around, you simply will not get far in OSDev. You have to be able to do things for yourself, because there won't always be a tutorial or free code available. There's no way around that, whether you like it or not.

With respect to this question, have a look at the NASM and FASM pages on the Wiki, and then try the NASM and FASM websites. It's not that hard.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by JamesM »

Hi,
ClarionCoder51 wrote:
Combuster wrote:I've been reading your latest posts, and I couldn't help noticing that you ask a lot of things that are explained on the wiki, could be found by a forum or google search. And you give the overall impression that either you are lazy, or unable to understand (basic) things on your own.

OS development is hard. Do you have what it takes? because right now I'd say "no".
Wow. I didn't know somebody could have such an attitude. True, I am lazy, but the wiki is filled with so much stuff that has nothing of actual use to me. As a matter of fact, I read the entire article on the soundblaster 16 and nowhere in that article did I find info on how to implement soundblaster 16.

I didn't become an OS Dev just to be trampled on by some moderator that likes to stalk me on the forum. You are the only member on this forum that I know that has not even bothered answer one of my maany innocent questions. Charge me with flaming if you want, but at least I know there's some descent people out there that can answer questions without insults. I don't think its even legal by the rules to be charged with flaming when you didn't even help.
Combuster flamed you for several reasons, all outlined in his post. You will find no sympathy from myself or any other regulars for being lazy. A simple google search, as Combuster pointed out, or an osdev.org forum search would have found you the answers you require.

We have a large signal:noise ratio here and are actively attempting to prune out stupid and irrelevant posts so that we can focus more on the intelligent posts. Rehashing the same advice again and again is not what we take time out of our day to do.

Long story short: your petulant response means that I'll now be looking at every post you write to judge its effectiveness: Thanks a lot, you've just made me take more time out of my day.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by Dex »

I think ClarionCoder51 question was a valied one, as just read a spec of both Assemblers will not answer the question.
Its like which car is best, people who have used both for OS Dev, can say why they when for that assembler.

And remember, no one can learn without copying.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by Combuster »

Dex wrote:And remember, no one can learn without copying.
Proof wanted.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: FASM vs. NASM: What's the Difference?

Post by Troy Martin »

Combuster wrote:
Dex wrote:And remember, no one can learn without copying.
Proof wanted.
*waves*

I generally disagree with Dex, but I learned most of my x86 assembly from copying. Sure, it was pretty stupid at the time, but I now know how to read/write/speak/breathe the language.

I did not, however, learn C from copying. My C came years before I learned ASM.
ClarionCoder51 wrote:Wow. I didn't know somebody could have such an attitude.
Meet Combuster (no offense.) And I wouldn't call it a bad attitude, just a hard-@$$ way of putting things straight (again, no offense.)
ClarionCoder51 wrote:I've been hearing alot about NASM, lately. There's NASM this and NASM that and "Hey, I use NASM, too!". I ended up using FASM by chance, but I never really compared the two before. What's the difference?
Mainly just syntax and the fact FASM has an ARM version. FASM is also easier to port for those who write their OS in assembly language. I prefer NASM because most of the OSDev tutorials, the wiki, and lots of people use it. And I also find it a lot easier to use, don't ask me why.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
ClarionCoder51
Member
Member
Posts: 28
Joined: Sun Aug 16, 2009 11:52 am
Location: Georgia, USA

Re: FASM vs. NASM: What's the Difference?

Post by ClarionCoder51 »

Dex, I applaud you. For me, I am a semi-newbie. I can understand the logic and order off code when implementing somethhing, but I need a snippet of code in order to grasp the big idea on the code side. If you give me which register to put incoming bytes in, I'll figure the rest out. And here's another thing: why all of a sudden people complaining about the fact that I don't google stuff? How on God's earth could I have figured out the answer to this post with google? YES. I GOOGLED IT. The answer isn't in the Wiki either. YES. I LOOKED IN THE WIKI. If people keep screaming in my ear to look in the Wiki for every question that I ask that isn't even there, then why would there even be a forum in the first place?

Oops!! Excuse my caps lock...
"The n00b zone is for loading and unloading newbies only."
Locked