OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 5:47 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: NASM vs. FASM
PostPosted: Tue Apr 12, 2005 4:29 pm 
I'm re-writing my OS, now in 100% my own code and 100% pure assembly. These are the two assembly compilers I was thinking of using, but I'm stuck betweern them.

Are there any benefits/drawbacks for OS development in each, or will they be pretty much the same? From what I'm hearing it looks like NASM should be the easiest here. Is there any other assemblers I should take a look at?

Thanks


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Tue Apr 12, 2005 6:41 pm 
FASM has nice macro support, is (AFAIK) more actively developed and can be ported to your OS far more easily (It's self-assembling) than NASM (Which requires a full C environment).


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Tue Apr 12, 2005 8:24 pm 
wow....didn't know that. I'll use FASM unless someone suggests a better one for my uses.

And didn't FASM get ported to MinuetOS? (...or something? Been so long.) How does one port an assembler?


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Tue Apr 12, 2005 8:52 pm 
How many other assemblers come with a manual on how to convert the assembler to run on your new OS ?, see here:
http://board.flatassembler.net/topic.php?t=1972

I started with nasm on my OS, but changed to fasm, and i could never go back to nasm.
One of the best things i like about Fasm is error checking, nasm gives you a line number, not easy to find, but Fasm show you the content of the line that coursed the error.

So my advice is go with FASM.


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Tue Apr 12, 2005 9:00 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 9:01 am
Posts: 842
Is there a CYGWIN(/Linux) version of FASM?

_________________
Only Human


Top
 Profile  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Tue Apr 12, 2005 9:07 pm 
there is a linux one, google a bit dude...


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 12:47 am 
I'm using FASM too.
I found some features very useful, compared to NASM : anonymous labels, macro support, and computing on symbols. For example of the last, you can define a label and then compute things like
Code:
((my_lbl shr 12) and 0xFF00) or 0x3
which is very useful to construct tables, like GDT and IDT without the need of construction code.


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 3:11 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
pini wrote:
I'm using FASM too.
I found some features very useful, compared to NASM :
anonymous labels,

Maybe you could elaborate a bit more on that one, but NASM had a lot of features concerning labels, among other local labels (e.g. you can have .loop at several places provided they are in different functions), macro-local labels, etc.

Quote:
macro support,

NASM has it too, and NASM's macros are especially powerful, allowing a context stack to be manipulated (so that your macros can nest, etc)

Quote:
and computing on symbols. For example of the last, you can define a label and then compute things like
Code:
((my_lbl shr 12) and 0xFF00) or 0x3
which is very useful to construct tables, like GDT and IDT without the need of construction code.

okay, that one was a bit harder to get working since i got messages saying "operator >> can only be applied on scalar values", but just patching to
Code:
[org 0]
my_lbl:

my_modified dd (((my_lbl-$$) >> 12) & 0xff00) | 3


Honnestly, the only "real" argument i see to prefer FASM is that it is self-compiling... yet i'm not sure it is a so great advantage: you could easily compile a version of NASM that matches your own OS on your DevStation (tm) and run the binary in your OS after that...

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 4:10 am 
Sure, Pype.Clicker, it isn't as hyped a difference as may be presented. However, the work involved in creating a DevStation with a corresponding C compiler would take more time.

I used NASM for a while and then moved over to FASM as well. My main reasoning is that it has specific support for it. It is moving into 64-bit environments as well (I beleive AMD support is done).


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 4:54 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 1223
Location: Sweden
fasm is smaller and self-compiling, that should be enought reasons to choose it.
Other then that, it only differs on small syntax stuff.

_________________
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub


Top
 Profile  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 4:59 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
if i compile NASM and then ndisasm it, it will produce self-compiling nasm ;)

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 5:51 am 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7612
Location: Germany
Regarding the self-assembling... I consider the Assembler to be a crutch that is necessary until higher level languages (C, C++, ...) become available for your target.

So I would be heavily working towards a complete C environment anyway... at which point the difference becomes mood.

Speed? I don't expect to reassemble that often, and even then, how big can the difference be, considering the power of the development systems we all are using today?

"More actively developed" weights much heavier in my opinion...

Just my 0.02?. (And since I am using GNU 'as' / AT&T syntax, you can probably discount me as nutcase anyway. :-D )

_________________
Every good solution is obvious once you've found it.


Top
 Profile  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 6:01 am 
Solar your point is well taken, better environments breed better (more) off-spring (to be analogical). But the point was either NASM or FASM. I think FASM is more useable than NASM especially given its current AVAILABLE support. Most assembler programmers would contend that using an assembler written in assembler seems more closely related to the programming the programmer is doing. Not to be prejudiced but rather a purest to the ART form. But then again, I'm a cynic. ;)


Top
  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 7:33 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 23, 2004 11:00 pm
Posts: 1223
Location: Sweden
Pype.Clicker wrote:
if i compile NASM and then ndisasm it, it will produce self-compiling nasm ;)

Well, have fun trying to get that disasm output to assemble fine.. :P

_________________
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub


Top
 Profile  
 
 Post subject: Re:NASM vs. FASM
PostPosted: Wed Apr 13, 2005 8:52 am 
I think I opened Pandora's Box with this thread.

FASM it is.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 86 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group