NASM vs. FASM

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:NASM vs. FASM

Post by Pype.Clicker »

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).
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:NASM vs. FASM

Post by Solar »

Welcome to the world of constant change. That feeling is the first sign that you're growing old. ;)
Every good solution is obvious once you've found it.
smiddy

Re:NASM vs. FASM

Post by smiddy »

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
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:NASM vs. FASM

Post by Brendan »

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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
FlashBurn

Re:NASM vs. FASM

Post by FlashBurn »

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 - !
DruG5t0r3

Re:NASM vs. FASM

Post by DruG5t0r3 »

I also belief that FASM generates smaller code than NASM
Ever tried to execute a "nop" with something smaller than 0x90 ?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:NASM vs. FASM

Post by Pype.Clicker »

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.
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: Select all

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.
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.
zyp

Re:NASM vs. FASM

Post by zyp »

as for editors: i use ********
Cool, I tought that I was about the only one that used ********.
erikgreenwald

Re:NASM vs. FASM

Post by erikgreenwald »

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
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:NASM vs. FASM

Post by Solar »

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. ;)
Every good solution is obvious once you've found it.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:NASM vs. FASM

Post by bubach »

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..
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:NASM vs. FASM

Post by Pype.Clicker »

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.
srg

Re:NASM vs. FASM

Post by srg »

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
Red Shaya

Re:NASM vs. FASM

Post by Red Shaya »

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.
AR

Re:NASM vs. FASM

Post by AR »

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).
Post Reply