News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Macro Assembler Syntax vs NASM - YASM - FASM

Started by LiaoMi, August 29, 2021, 11:56:52 PM

Previous topic - Next topic

LiaoMi

Hello everybody  :cool:,

I have a question, why parallel projects like NASM or FASM are so popular among system programmers? Even Microsoft and Intel, as well as Linux developers use these assemblers in their work. All projects are often assembled with only two assemblers, NASM and FASM. Intel, for example, wrote a small python converter to convert MASM to NASM.

Nasm vs Masm? - http://www.asmcommunity.net/forums/topic/?id=28555
What differs MASM from NASM? http://www.asmcommunity.net/forums/topic/?id=6544

QuoteNASM is considered to be one of the most popular assemblers for Linux.
Is this the reason for the popularity?

QuoteNASM can create flat binary files, usable to write boot loaders, read-only memory (ROM) images, and in various facets of OS development.
Maybe this is the reason?

QuoteIn July 2009, as of version 2.07, NASM was released under the Simplified (2-clause) BSD license. Previously, because NASM was licensed under LGPL, it led to development of Yasm, a complete rewrite of the NASM under the New BSD License. Yasm offered support for x86-64 earlier than NASM. It also added support for GNU Assembler syntax.

Chapter 4: The NASM Preprocessor
https://www.nasm.us/xdoc/2.14.02/html/nasmdoc4.html

From those who use these assemblers, I often hear that the macro assembler(MASM) is too complicated.

https://en.wikipedia.org/wiki/Comparison_of_assemblers
FASM   Tomasz Grysztar   Windows, DOS, Linux, Unix-like
MASM   Microsoft                   Windows, DOS, OS/2
NASM   Simon Tatham     Linux, macOS, Windows, DOS, OS/2
Yasm   xxx                       Windows, DOS, Linux, Unix-like

https://www.reddit.com/r/asm/comments/gzycfn/ive_been_looking_at_fasm_instead_of_using_nasm/
QuoteI've been looking at FASM instead of using NASM. What are the benefits?
I am a Linux user. I use Netwide Assembler in x86, and I want to use FASM (I am mainly learning assembler for OS Development). Here is what I want from my assembler:

To be simple to use. I don't like having all this complex syntax, such as GAS assembler with it's AT&T syntax.
To be fast. I don't want to wait long to compile my code, and it should also run fast.

Quick Start for MASM Users
https://www.nasm.us/doc/nasmdoc2.html#section-2.2

After all, I came to the conclusion that most assembler programmers who do not use macro assembler do not know how to combine high-level logic with assembler, logic, that is clearly reflected in the syntax of macro assembler. This was a great discovery for me!

Alternative opinions are welcome  :tongue: :thup:

HSE

Hi Liaomi!!

Quote from: LiaoMi on August 29, 2021, 11:56:52 PM
why parallel projects like NASM or FASM are so popular among system programmers? Even Microsoft and Intel, as well as Linux developers use these assemblers in their work. All projects are often assembled with only two assemblers, NASM and FASM.
They usually build small and specifics tools. For sure there are source code templates available in that flavors.

Quote from: LiaoMi on August 29, 2021, 11:56:52 PM
...most assembler programmers who do not use macro assembler do not know how to combine high-level logic with assembler, logic, that is clearly reflected in the syntax of macro assembler.
At least they don't have the training, NASM and FASM are not well suited for big projects or fast projects. Their macros are almost bare metal. In MASM we can see complex projects builded by people with training in Basic or C++ projects, and is possible to translate some of that projects easily.

Quote from: LiaoMi on August 29, 2021, 11:56:52 PM
From those who use these assemblers, I often hear that the macro assembler(MASM) is too complicated.
Yes, you need a forum  :biggrin: :biggrin: :biggrin:

Regards, HSE.
Equations in Assembly: SmplMath

jj2007

IIRC they don't have macros that return values as in print str$(ecx). Otherwise, no big differences. Speedwise they are probably similar, especially if you consider the fast MASM clones AsmC and UAsm.

nidud

#3
deleted

nidud

#4
deleted

hutch--

 :biggrin:

I guess its the case that different assembler target different tasks. NASM has long been a specialised tool that can be used in unusual places and that is much of its strength. FASM is in fact a very good tool that produces good quality code when written properly as is the case with GAS that is highly under rated.

MASM (32 bit) is an old industry standard and had been going since 1982 so M$ have had long enough to keep tweaking it for later OS versions. The 64 bit version is much later and apart from a very similar pre-processor, it is a different animal to the old ML.EXE, its simpler and faster to use than the old ML.EXE.

The collection of Watcom derivatives effectively use the architecture (user level) of the 32 bit version of MASM and cater for a market where MASM licencing excludes their use. Both John and Nidud have done quality development work on Watcom derivatives and the only problem with John's work is the lack of support with libraries and includes. I don't know enough about Nidud's assembler to make any detailed comments.

One factor that is missed by many is the duration and availability over long periods. Many have fallen by the wayside over time but MASM just keeps going and while it is hardly altruism from M$, it just happens to be that an OS vendor must have their own for their own internal purpose.

TouEnMasm

Quote
The 64 bit version is much later and apart from a very similar pre-processor, it is a different animal to the old ML.EXE, its simpler and faster to use than the old ML.EXE.
:toothy:
Fa is a musical note to play with CL

hutch--

 :toothy:

This is a comment from someone who still tries to use ML64 like the olf ML.  :tongue:  :skrewy:

daydreamer

so which assembler is most suited for bare metal coder?,masm must be a waste with all its macros for bare metal coder :greenclp:
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

Any assembler can write pure mnemonic code. Not so many assembler programmers can write it.  :tongue:

No one forces you to use the pre-processor and as you know, REAL MEN[tm] write in HEX notation.  :skrewy:

HSE

Quote from: hutch-- on September 02, 2021, 09:19:40 PM
REAL MEN[tm] write in HEX notation.  :skrewy:
Yesss!  And they can build computers with needles and coconuts.  :biggrin:
Equations in Assembly: SmplMath

TimoVJL

Most programmers just use use best available tools :undecided:
May the source be with you

daydreamer

Quote from: TimoVJL on September 03, 2021, 12:10:57 AM
Most programmers just use use best available tools :undecided:
But with online compiling, run programs to exercises don't that mean you can't avoid indirectly use server side scripting? :D
my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

hutch--

 :biggrin:

Hector,

> And they can build computers with needles and coconuts.

You will have to share this technique with me.

askm

The following is a transcript:
The only thing I can think is the abacus, using a hieroglyphic level language
constructs. Did history ever record the Abacus Machine Language Manual ?
Like the transistors that shrank later, the early abacus foundries had to shrink
the coconuts to something smaller, like some tree wood or soft mineral chunk.
Branch (tree) prediction ? Micro (soft) minerals ?
We have it easy today. Imagine having to push and pop coconuts with crude
tools while possibly being poked with needles that overflowed the abacus stacks.
There must be some evidence of this in the archaeological digs.
I know what you're thinking. Yes there was an iAbacus, and was first used in-cave.
Hackers later came in. They knew they had to backup. Hit over the head, the
first memory bugs and vulnerabilities were created. Come to thump of it, why
coconuts? Why not onions? Thus the beginnings of cryptography, and onion
networks. Monkey please... get off my backup ! Sorry, about that.
We need to uncover further and explore further the earliest unknowns of syntax.