4 ms·
Can anyone recommend an x86 assembler to use in 2022? Is NASM still the default choice? Also, what about a modern x86 reference, most of what I have and pretty
by patentatt 4y ago
Can anyone recommend an x86 assembler to use in 2022? Is NASM still the default choice? Also, what about a modern x86 reference, most of what I have and pretty much stops at the pentium era. Any source for an authoritative reference that covers x86-64, all the varying SIMD flavors, and any other new and interesting developments in the ISA in the last ~20 years?
- jcranmer 4y agoFor a standalone assembler, I think YASM is a little more the default nowadays than NASM, although honestly the two are probably very interchangeable. Another major option is to use your C compiler's assembler (gas, clang -cc1as, or masm), or suck it up and use inline assembly directly.
- Okx 4y agoHere is the AMD64 reference manual https://www.amd.com/system/files/TechDocs/40332.pdf https://www.amd.com/system/files/TechDocs/40332.pdf The stuff you will need most is in Volume 3.
- sylware 4y agofasmg: https://flatassembler.net/ https://flatassembler.net/ it is written in x86_64 assembly (namely bootstrapping is sane not like gcc/clang/etc). x86/x86_64 intel syntax. It is actually the most powerful macro processor I know of, then be careful not to lose yourself in there and not to forget to write assembly. It has experimental support for other ISAs like arm (maybe risc-v in the future). The best way to see it, is as a macro language specification which targets writting assembler languages, with a x86/x86_64 reference implementation. nasm: x86/x86_64 intel syntax used by ffmpeg. Main issue: its SDK is horrible with disgusting code generators and so on. It has also a powerfull macro processor, then carefull not to abuse it. gas: from GNU binutils, tons of ISAs, but for x86/x86_64 you should switch it from its default, AT&T syntax, to intel syntax. If some definitions have to be shared with C, I would recommend to combine their usage with a C preprocessor (gas is made to be friendly to a C pre-processor).
- anta40 4y agoHow compatible is fasmg with fasm? I still use fasm on Windows on Linux, but no luck in MacOS since fasm is still written in 32-bit assembly and MacOS doesn't support 32-bit apps anymore...
- sylware 4y agoHeard the compatibility should be "mostly" ok: fasmg introduces some stuff missing from fasm in order to write more comprehensive assemblers (for instance the CALM macro language (in addition of the classic macro language).
- anta40 4y agoSo in general, any fasm code should be compilable with fasmg? In some cases, perhaps some tiny modifications are needed?
- sylware 4y agoSorry, I don't recall the details, but you can head on their real web (no javascript) forums and ask them. I did cheat since I started directly with fasmg. Nowadays, I use 2 assemblers: fasmg and gas (I am only a user of nasm via ffmpeg building, and I _really_ dislike nasm SDK).