OSDev.org
https://forum.osdev.org/

NASM vs. FASM
https://forum.osdev.org/viewtopic.php?f=1&t=10402
Page 2 of 3

Author:  Pype.Clicker [ Wed Apr 13, 2005 9:06 am ]
Post subject:  Re:NASM vs. FASM

Jubbens wrote:
I think I opened Pandora's Box with this thread.


Hehe .. asking ppl what assembler they prefer is almost as dangerous as asking what editor is the best (please don't answer).

That being said, i'm always surprised of how much importance asm people give to the fact their asm-devkit is self-sufficient ... What linker would you use with your FASM-produced binaries ? What library archive maintainer ? What debugger ? ...

I guess you got my point. Even if running an assembler in your OS is fine, you're still far away from _developing_ under your own OS , imvho.

And yes, i must admit i'm a bit disappointed NASM is no longer the #1 reference as it was 5 years back (where it seemed to be the solution to MASM vs TASM conflict).

Author:  Solar [ Wed Apr 13, 2005 9:17 am ]
Post subject:  Re:NASM vs. FASM

Welcome to the world of constant change. That feeling is the first sign that you're growing old. ;)

Author:  smiddy [ Wed Apr 13, 2005 9:22 am ]
Post subject:  Re:NASM vs. FASM

Solar wrote:
Welcome to the world of constant change. That feeling is the first sign that you're growing old. ;)


The realist in the group speaks up!

BTW, Pype.Clicker, EDLIN is still my favorite...but then there are those who still use vi too. Which to Solar's point, means I one old mutha! ;D

Author:  Brendan [ Wed Apr 13, 2005 9:28 am ]
Post subject:  Re:NASM vs. FASM

Hi,

Pype.Clicker wrote:
What linker would you use with your FASM-produced binaries ? What library archive maintainer ? What debugger ? ...


You'd get NASM/FASM to generate pure binaries, rather than object files, and use %include "library_stuff.asm" instead of libraries.

This is what I do anyway - normally make is the only other tool I use (but I have used batch files under DOS instead). I only use linkers and libraries when I use compilers...

As for debugging, I use Bochs, ndisasm and a little home-made utility that searches for my debugging markers within my binaries. In conjunction with my OS's critical error reports I've never really needed anything else. It's not too good when trying to debug C code though..


Cheers,

Brendan

Author:  FlashBurn [ Wed Apr 13, 2005 12:18 pm ]
Post subject:  Re:NASM vs. FASM

FASM?s macro abilities are better than the ones of NASM! I also belief that FASM generates smaller code than NASM. I used NASM for a long time, but when I wanted easier my code I switch to FASM, because of its macro abilities.

And if you want to develop for 64bit, FASM is the only way to go, because NASM doesn?t support it and YASM is not that useable - at the time I tested it - !

Author:  DruG5t0r3 [ Wed Apr 13, 2005 7:40 pm ]
Post subject:  Re:NASM vs. FASM

Quote:
I also belief that FASM generates smaller code than NASM


Ever tried to execute a "nop" with something smaller than 0x90 ?

Author:  Pype.Clicker [ Thu Apr 14, 2005 1:59 am ]
Post subject:  Re:NASM vs. FASM

FlashBurn wrote:
FASM?s macro abilities are better than the ones of NASM!

Still waiting for that to be demonstrated. if you have a pointer to a page that shows some (useful) macro FASM can do and which is impossible for NASM, or some page that shows how easier it is to program macros for FASM compared to NASM macros, you're welcome.

Quote:
I also belief that FASM generates smaller code than NASM.

NASM was known to be a do exactly what you're told assembler. So if you want to use a 1-byte constant or a short displacement, you should tell it to the assembler. Otherwise, the assembler just picks what the default stuff means.

So,
Code:
mov eax,1   ;; this one will take 5 bytes iirc
mov eax,byte 1;; this one takes only 2 bytes


That may be awkward or save your life depending on the situation, but i admit it is awkward more often than it saves your life.

Quote:
And if you want to develop for 64bit, FASM is the only way to go, because NASM doesn?t support it and YASM is not that useable - at the time I tested it - !

Now *this* is a real argument.

Author:  zyp [ Thu Apr 14, 2005 3:33 am ]
Post subject:  Re:NASM vs. FASM

Quote:
as for editors: i use ********

Cool, I tought that I was about the only one that used ********.

Author:  erikgreenwald [ Thu Apr 14, 2005 4:17 pm ]
Post subject:  Re:NASM vs. FASM

gas :)

I used to favor nasm, but gas is "just there", and is reasonable similar on other archs, so all you have to learn is the arch specific stuff, not the assembler syntax... at&t style also makes me smile :)

-Erik

Author:  Solar [ Thu Apr 14, 2005 11:53 pm ]
Post subject:  Re:NASM vs. FASM

Pype started to asterix any editor names, as to keep this on-topic. ("Favourite Editor" is such a piece of OT-bait...)

I followed up. Just in case you're wondering. Keep this on the topic of assemblers. ;)

Author:  bubach [ Fri Apr 15, 2005 4:12 am ]
Post subject:  Re:NASM vs. FASM

Pype.Clicker wrote:
Still waiting for that to be demonstrated. if you have a pointer to a page that shows some (useful) macro FASM can do and which is impossible for NASM, or some page that shows how easier it is to program macros for FASM compared to NASM macros, you're welcome.


Don't excatly know what NASM can do, but this may give you a hint of fasm's marco syntax:

http://www.decard.net/?body=tajga&chapter=preproc
http://flatassembler.net/docs.php?article=manual#2.3.3
http://board.flatassembler.net/forum.php?f=14 - Look in some threads..

Author:  Pype.Clicker [ Fri Apr 15, 2005 4:31 am ]
Post subject:  Re:NASM vs. FASM

same for nasm: http://nasm.sourceforge.net/doc/html/na ... tion-4.3.2

- macro-local labels: just use %%label
- labels concatenation: there used to be things like [tt]__Symbol_%1_%2[/tt], but it appears latest versions also have [tt]whatever %+ anything[/tt]

The only thing i cannot find in nasm is the "%var in <eax,edx,ecx,ebx>" thing. Dunno how often one uses this, though.

Author:  srg [ Sat Apr 16, 2005 3:08 pm ]
Post subject:  Re:NASM vs. FASM

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


oh dear, i'm moving from nasm to gas myself, I wondered what the nervouse twitch was, at least there is relative harmony between architechtures with gas. You learn it once and appart from small details, it's the same.

srg

Author:  Red Shaya [ Sun Apr 17, 2005 2:08 am ]
Post subject:  Re:NASM vs. FASM

WOW
Ten years ago assembler programming was considered a thing of the past, used by old "dinosaurus" programmers.

It seems that recent years had changed this way of thinking and one of the strongest evidence are the new flavors of assemblers and this "what's the best assembler" argument going in here.

As for myself (as you might understand from my signiture) An assembler is a luxury I'm still very far from achieving. But I do enjoy the listing feature of FASM when I try to improve my opcode coding skills :-) I think that an option to specify the include library as a command line parameter (currently you need to set up an environment variable for it) would be nice. But other then that I had no major difficulties using it.

Author:  AR [ Sun Apr 17, 2005 3:23 am ]
Post subject:  Re:NASM vs. FASM

Red Shaya wrote:
It seems that recent years had changed this way of thinking and one of the strongest evidence are the new flavors of assemblers and this "what's the best assembler" argument going in here.
Something to point out, here in the OS Dev world, it is impossible to work without an assembler so this isn't a reflection of the industry at large. Microsoft is pushing developers onto their .Net emulator which doesn't support assembly (unless you count IL).

To move on topic, I use NASM/YASM for external assembly files (ISR stubs and the entry point) but I am reasonably comfortable with GAS for inlining although I am reluctant to use it for everything (I don't feel like having to learn its directives for declaring sections and buffers and such when I already know how in NASM although I probably will eventually).

Page 2 of 3 All times are UTC - 6 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/