Is NASM supported by LLVM?

I saw some LLVM generated assembly in NASM format, but did find this support in the official release. Is this supported?

If by “NASM format” you mean Intel syntax, then yes. In my experience most LLVM tools refer to it with the option “-x86-asm-syntax=intel”. For example, tools/llvm-objdump has this flag.

–Sean Silva

Could generated assembly with option “-x86-asm-symtab=intel” be assembled by nasm directly?

My intuition is that it will almost, but not quite, work. However, I would suggest that you test it to find out though.

–Sean Silva

I have no idea where people get this silly notion that Intel syntax is the same as Netwide* syntax. They are NOT the same. They are similar, but not the same.

LLVM does not support the Netwide syntax. (There was talk of it, but nothing ever came of it–so far, at least) It does, however, support the Intel syntax… sort of. Specifically, it supports the GNU variant of it (where the actual instructions use Intel syntax, but pseudo-ops use GNU syntax–‘.byte’ instead of ‘DB’, for example).

  • That’s what the ‘N’ in "NASM’ stands for.