The one issue with "system assembler" is when it comes to Windows.
The closest Windows has to a "system assembler" is MASM, which comes with Visual Studio. However, according to a 2010 post by Chris Lattner:
Nope, llvm's .s output is only compatible with GAS and other at&t syntax assemblers. It turns out that MASM syntax is highly ambiguous and MASM is not production quality for use by a compiler. This is why visual studio doesn't go through it. Long term, we'd like LLVM to be able to write out .o files directly [..]
In the 9 years since then, LLVM has indeed become able to write out .o files directly, but its assembly format is still based on GAS (GNU as), and incompatible with MASM. This applies to both the assembly LLVM generates (e.g. with --emit asm
) and the assembly it accepts in inline assembly blocks. The incompatibility doesn't have to do with instructions themselves: MASM uses Intel syntax whereas GAS defaults to AT&T syntax, but GAS and LLVM's assembler both support switching to Intel syntax with the .intel_syntax
directive.
The issue is with things like assembler directives and the syntax for declaring symbols. For example, to declare a symbol named msg
containing a nul-terminated string:
MASM syntax: | msg db "Hello", 0 |
GAS/LLVM syntax: | msg: .asciz "Hello" |
Now, you could argue that MASM isn't a true "system assembler" anyway. According to the post, not even MSVC goes through it – I don't have the expertise to confirm that or know whether it's changed since then, although I doubt it's changed. (However, MSVC does support emitting "listing" files that at least look like MASM-flavored assembly.) And Windows has a history of developers using a variety of assemblers rather than standardizing on one; in addition to MASM there's NASM, FASM, TASM, etc., which have their own custom syntaxes. If there's no "system assembler", then we could be justified in ignoring MASM and continuing to use GAS syntax.
Alternately, we might say MASM does count as a system assembler but ignore it anyway. It's more convenient to use the syntax already supported by LLVM, and I doubt many people are particularly attached to MASM and its "highly ambiguous" syntax, or enthusiastic about having to use different syntax depending on the OS. But such a decision does feel somewhat arbitrary and Unix-biased.