2
votes

Wikipedia states:

High-level assemblers in computing are assemblers for assembly language that incorporate features found in high-level programming languages.

It goes on to say:

High-level assemblers typically provide instructions that directly assemble one-to-one into low-level machine code as in any assembler, plus control statements such as IF, WHILE, REPEAT...UNTIL, and FOR, macros, and other enhancements.

Finally, it refers to some high-level assemblers:

More recent high-level assemblers are Borland's TASM, NASM, Microsoft's MASM, IBM's HLASM (for z/Architecture systems), Alessandro Ghignola's Linoleum and Ziron.

Out of these, I've only used NASM, but I can understand why it is a high-level assembler; it has structures, macros and a very extensive preprocessor in general. However, when I see FASM's Wikipedia page, it refers to FASM as a low-level assembler, which I don't really get. FASM not only supports structures and macros (I don't know too much about the preprocessor), but also supports asssemble-time if statements. Is there any other rule that specifies whether an assembler is high-level or low-level? The FASM Wikipedia page says it intentionally does not support many command-line options, but does that alone make it a low-level assembler?

1
NASM does not have IF or WHILE directives that are assembled into machine code, only %if and %rep which are assemble-time control flow directives of the preprocessor. Not runtime. It does have preprocessor macros but so does FASM. I wouldn't call NASM "high level".ecm
Terms like high-level and low-level are relative terms and are in the eye of the beholder. They are as much opinion as fact. I would not get too worked up about thinking of those terms as definitions with hard rules, because they are definitions with rules. The author in this case had a definition in mind and acted on it. An author for another page had a definition in mind and acted on it. There is a long list of terms that falls under this category, starting with lets say the term embedded, but also including the terms assembly language and assembler.old_timer
Yeah, that makes sense. I guess I just expected it to be a fact/something widely agreed upon if it was on a Wikipedia page.mediocrevegetable1

1 Answers

7
votes

NASM has nice macro features, but it doesn't have nonsense like .IF, .WHILE, .REPEAT...UNTIL, and .FOR directives built-in like MASM does. MASM is so old that some people had to write in asm when they'd rather have been using a high level language. NASM was designed recently enough that if you want that, just use a compiler so it can optimize instead of just naively filling in a template for MASM .IF directives.

I wouldn't call NASM a "high level" assembler.

Although those terms have no specific technical meaning, just kind of soft design-goal / self-promotion language. FASM itself is written in asm, and certainly glorifies how stripped down and small it is. I think calling itself a "low-level" assembler is intended as a declaration that "we're intentionally not MASM"; we're giving you tools that are useful to really write asm, not to pretend to be a higher level language.

MASM/TASM also has "variables" - foo dd 123 not only defines foo as a symbol, using foo in other instructions like add foo, 1 implies an operand-size for those instruction. NASM and FASM do not have any weird stuff like this: you can look at a source line and know how it assembles without looking elsewhere to find out if foo is an equ constant or a symbol.

IMO, NASM is a nice macro assembler, nothing more nothing less. It's not any "higher level" than FASM. NASM seems very out-of-place in that list of "high level" assemblers.