flat assembler
Message board for the users of flat assembler.

Index > Main > FASM vs. NASM vs. MASM

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



Joined: 14 Jan 2014
Posts: 51
upsurt 14 Jan 2014, 16:23
Hi Guys

I had some experience with MASM32. But the last line of code I wrote, was around 6 years ago.
Could you tell me your personal reason for using FASM instead of MASM or NASM?
I'm interested in "low level asm". 32/64-Bit, Windows (but Linux as well)

Anyway, I will try all three by my self. But would like to hear about your opinion.
MASM is less portable (or even forbidden to be ported), so I think FASM or
NASM will be my choice. What makes FASM "better" than NASM for your needs?

Thank you very much in advance.
Post 14 Jan 2014, 16:23
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1672
Location: Toronto, Canada
AsmGuru62 14 Jan 2014, 18:02
I dropped TASM for the following reasons:

1. FASM has no linker --> one building step (less hassle to create a working code).
2. FASM is extremely fast: it takes a second or two to build a 100K EXE file - a LOT of lines!!.
Post 14 Jan 2014, 18:02
View user's profile Send private message Send e-mail Reply with quote
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 14 Jan 2014, 18:54
Thank you, AsmGuru62!

Does NASM need a linker?
Post 14 Jan 2014, 18:54
View user's profile Send private message Reply with quote
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 14 Jan 2014, 20:15
I just started with FASM and I really like it so far Smile
Post 14 Jan 2014, 20:15
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1403
Location: Piraeus, Greece
Picnic 14 Jan 2014, 20:23
Post 14 Jan 2014, 20:23
View user's profile Send private message Visit poster's website Reply with quote
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 14 Jan 2014, 20:51
Hi Picnic. Thank you very much! Smile
Post 14 Jan 2014, 20:51
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 843
Location: Jakarta, Indonesia
TmX 15 Jan 2014, 01:36
AsmGuru62 wrote:
1. FASM has no linker --> one building step (less hassle to create a working code).


If I'm not mistaken, Tomasz stated that FASM has a built-in linker. Unfortunately this feature is Windows only.
Post 15 Jan 2014, 01:36
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 15 Jan 2014, 03:12
Not quite accurate. It is true that Windows programs written in fasm can be linked against DLLs, but that is because of the flexibility of the PE formatter which allows you to write your own import section, and not specially purposed directives (like extrn in object formats) that allows you to reference external code/data/symbols.
Post 15 Jan 2014, 03:12
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 843
Location: Jakarta, Indonesia
TmX 15 Jan 2014, 04:00
LocoDelAssembly wrote:
Not quite accurate. It is true that Windows programs written in fasm can be linked against DLLs, but that is because of the flexibility of the PE formatter which allows you to write your own import section


Thanks for your correction.

LocoDelAssembly wrote:

and not specially purposed directives (like extrn in object formats) that allows you to reference external code/data/symbols.


which is why a linker (polink, golink, etc) is needed, right?
Post 15 Jan 2014, 04:00
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 15 Jan 2014, 06:06
If you use one of the object formats and you want to produce an executable out of them then you'll need something to do the linking. A linker is one option, but by taking advantage of the file directive plus the virtual directive plus the interpreted language of fasm, you could get some sort of built-in linker, with the extra benefit of supporting static linking, something that is currently not possible with the standard set of macros which only allow dynamic linking. Don't know if someone attempted this, I've been out way too long...
Post 15 Jan 2014, 06:06
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20461
Location: In your JS exploiting you and your system
revolution 15 Jan 2014, 06:29
LocoDelAssembly wrote:
Don't know if someone attempted this, I've been out way too long...
Not that I have seen. But one never knows what has been done and never made public.
Post 15 Jan 2014, 06:29
View user's profile Send private message Visit poster's website Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal 15 Jan 2014, 13:46
Just some reasons why I use FASM:

* Supports ANY/ALL CPUs+OSs (that you define)
* Written in 100% FASM assembler
* Efficient source code. NASM's C/C++ source is wasteful, poorly written, using massive structures to represent instructions. At the time FASM was released in 99'-00', I was writing a long list of reasons "Why I hate NASM" (its source code) and was using MASM reluctantly (mostly VESA+DirectX)
* Powerful macro system
* Fastest processing speed. Compare to SLOW MASM+NASM. See for yourself
* Updated to support latest CPU instructions
* Editable, redistributable. See LICENSE.TXT
* Lightweight, one executable. MASM is a big bloated package
* Used to create OSs, programs, games, more impressive projects than any other assembler. Just look at what users have created with FASM.

MASM's restrictive license: http://www.masm32.com/license.htm
Quote:
The MASM32 project cannot be used to create open source software. 3. None of its components or source code are redistributable. 4. You cannot use the MASM32 Project to write software for Non-Microsoft Operating Systems
Post 15 Jan 2014, 13:46
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 15 Jan 2014, 15:10
@m3ntal I agree to all except that MASM and MASM32 are 2 different things. MASM32 is written in MASM.
Check this page :
http://wiki.osdev.org/MASM
Quote:
NOTE: Using MASM for operating system development is not prohibited in the license agreement although you may sometimes hear that. This is because people often confuse the MASM and MASM32 licenses; they are 2 unrelated projects.

Some points :
NASM is too hungry, 893KB!! Is it what is supposed to be a size of an assembler?
Being a developer of an OS I would say it's too much, I have ported FASM finally (sort of),
to my OS and I'm trying to translate all my code to FASM.
MASM never used it and will never, who needs MASM when there's already
NASM and FASM.
FASM requires less syscalls, no C libraries, or C++ libs.
Self assembling ability, I can compile FASM under my "own" OS, since I've ported it.
Community and docs, FASM was/is/will have the best docs and community.
Intention, FASM wasn't created to take over all assemblers, I guess it was made to
overcome some limitations of other assemblers.
FASM is future, I guess it's creation is very similar to that of Linux.
Post 15 Jan 2014, 15:10
View user's profile Send private message Reply with quote
dogman



Joined: 18 Jul 2013
Posts: 114
dogman 15 Jan 2014, 17:21
m3ntal wrote:
Just some reasons why I use FASM:

* Supports ANY/ALL CPUs+OSs (that you define)


What does "(that you define)" mean?

_________________
Sources? Ahahaha! We don't need no stinkin' sources!
Post 15 Jan 2014, 17:21
View user's profile Send private message Reply with quote
m3ntal



Joined: 08 Dec 2013
Posts: 296
m3ntal 15 Jan 2014, 17:45
dogman: Any instructions that are defined by macros. See Magic-ARM assembler and Java assembler, both written in FASM X86.

sid123: I'm referring to MASM32. M$ confuses people by having hidden separate licenses. Search google for "MASM license". Which one appears at the top of the list? Which one do most users read?
Quote:
Being a developer of an OS...
Real programmers can write their own code. A "developer" is not one who takes source code written by different people then claims it as their own.
Post 15 Jan 2014, 17:45
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 15 Jan 2014, 18:59
I personally prefer the syntax and handling of certain special cases like:
Code:
cmp eax,'WORD'
db (('0123' shr 8) and $F)    
but something I've found more and more useful is the power of the macro system. I've even been using it as a scripting language of sorts for generating HTML, converting binary data and even building code for other languages using shared headers with specialised generator builds.
Post 15 Jan 2014, 18:59
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 13084
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 0010456
sleepsleep 15 Jan 2014, 20:33
/me waiting for next generation assembler,
i could see so huge space for more intelligent, simpler, beautiful, assembler,

maybe i see an objective like below,
a good assembler should be the one that people have almost zero question to begin, they feel so natural to thoughts, easy to pick up, .....
Post 15 Jan 2014, 20:33
View user's profile Send private message Reply with quote
semmir



Joined: 29 Sep 2013
Posts: 4
semmir 16 Jan 2014, 06:14
Hi upsurt

If you used MASM32 you could think about using JWASM. It's almost 100% compatibile assembler with MASM for 32/64 bits and many OSes(Linux too). It's not restrictive as MASM. It is free and opensource project.

http://japheth.de/
Post 16 Jan 2014, 06:14
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 16 Jan 2014, 07:20
Quote:
A "developer" is not one who takes source code written by different people then claims it as their own.

Well I call that "reusing" code rather than copy-paste. Linus Torvalds himself says that he mostly merges code from other developers.
And I never claim other's code as my own.
From my Website wrote:

Mike Saunders --> MikeOS Developer
Matej Horavat ---> Memory Allocator
Joshua Beck --> BASIC Programs
Troy Martin --> CPUID Program
XanClic ---> Network Driver
MessiahAndrw --> 3D Engine
Me239 --> BMP Viewer

WINLIB is written by me, PCGUI is written by me, The OS Loader is written
by me, EXTFLOPPY Services are written by me, what else? (I know none of you guys know what I am talking about Razz),
Even for the smallest things I've given credit? Did I take any of your code?
If I did, sorry. Please tell me that I did.
Also, if you look at the source code :
Quote:

; kernel/kernel.asm --> Kernel
; This is loaded from the floppy drive by NTLOAD.BIN, as KERN86.BIN.
; First we have the system call vectors, which start at a static point
; for programs to use. Following that is the main kernel code and
; then additional system call code is included.
; ==================================================================
; This was written by Mike Saunders and his great team. I modified it
; by removing certain functions like the TUI, and added a cool looking
; CLI + So-called GUI.

Quote:
Real Programmers

Well Real Programmers theoretically(in dreams) learn by reading books and manuals, but tell me, how many of you guys haven't used external sources as a means of learning,
PS. Please, I am not Dex, I can't stand arguments.

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 16 Jan 2014, 07:20
View user's profile Send private message Reply with quote
dogman



Joined: 18 Jul 2013
Posts: 114
dogman 16 Jan 2014, 10:50
m3ntal wrote:
dogman: Any instructions that are defined by macros.


That hardly means any and all CPU or OS. You do realize there is more to life than Windows/Linux and Intel/ARM...even if those things win on pure numbers.

m3ntal wrote:
Real programmers can write their own code. A "developer" is not one who takes source code written by different people then claims it as their own.


I agree with you but things changed dramatically because of C and especially C++ and Java which all promote reliance on so many libraries that now sadly most "developers" are just cut-and-paste jockeys. Many big pieces of software are a little code invoking 10,000 classes or 10,000 library calls.

Even assembly developers get stuck with this in *NIX (maybe Windows also, I have no idea) since the syscalls are not very helpful and people really need to use libc or spend their lives writing services the OS should have provided in the first place.

_________________
Sources? Ahahaha! We don't need no stinkin' sources!
Post 16 Jan 2014, 10:50
View user's profile Send private message 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


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.