3 ms·
It looked promising right up until the first code, and then I saw you're writing in AT&T syntax. AT&T syntax is such an abomination against nature and the gods
by csense 10y ago
It looked promising right up until the first code, and then I saw you're writing in AT&T syntax. AT&T syntax is such an abomination against nature and the gods of computing that every time I see it I want to gouge my eyes out.
AT&T syntax is this weird awful syntax only used by GNU as. The syntax is some leftover from an assembler from the early UNIX days which was clearly written by a very lazy person. Whoever came up with it apparently thought to themselves, "If we make source files put a % character in front of registers and a $ character in front of constants, then I don't have to think too hard about how to write a parser. If we make source files specify their width in a suffix, then we don't have to think too hard about how to get this information out of the register name. And let's put our operands in (source, destination) order instead of (destination, source) order just to be evil and confuse people!"
Aaagggghh. If gas wasn't used as the backend of gcc, I guarantee exactly zero people would use it, because AT&T syntax is so awful.
You should consider posting an update using NASM / YASM (or if you feel you must use GAS, use its directive for Intel syntax). Your readers will thank you.
- ndesaulniers 10y agoYou should do it on your blog.