2 ms·
> Why do people use NASM? Faster binaries? There's nothing NASM can do to produce faster binaries than any other assembler - as it doesn't control which instru
by chrisseaton 5y ago
> Why do people use NASM? Faster binaries?
There's nothing NASM can do to produce faster binaries than any other assembler - as it doesn't control which instructions to generate - they're specified entirely by the user.
- glandium 5y agoActually, nasm does have optimization passes. https://nasm.us/doc/nasmdoc2.html#section-2.1.24 https://nasm.us/doc/nasmdoc2.html#section-2.1.24 That's not full of details, but one thing that it does on x86_64, for example is replace instructions that set 64-bits registers to immediate values smaller than 2^32 with instructions that set the equivalent 32-bits register (because that's a shorter equivalent, because those instructions zero-extend the value).
- pjmlp 5y agoThat is common in most Assemblers, RISC ones like MIPS even go further with pseudo instructions to work around how low level RISC opcodes tend to be.