News for hackers. Stuff that matters.
Re:NASM Assembly Language Tutorials by glandium on Monday January 03, 2022 @09:06PM (#29790283)
Actually, nasm does have optimization passes. 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).
Re:NASM Assembly Language Tutorials by pjmlp on Tuesday January 04, 2022 @02:33AM (#29792346)
That 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.