|
|
|
|
|
by jcranmer
871 days ago
|
|
If you want fun, there's the x86 assembly syntax where the destination is the first register, and the x86 assembly syntax where the destination is the last register. One is the syntax as is used in official documentation (the Intel and AMD manuals), most reverse engineering tools, etc. The other is the syntax most commonly used in practice because it's what gcc defaults to and actually isn't documented (which gets into a problem when you start running into what gcc figured was the best way to adapt AVX-512 EVEX stuff into assembly). So there's a lot of times where I'm staring at x86 assembly and going "wait, which version is this? the one that does destination first or destination second?" |
|
ITYM AT&T :). The idea is that the basic grammar is common across architectures to help compiler backend authors. The historical reason for the ordering is because that’s how it was on the PDP-11, the “mother” assembly. And all AT&T/GNU versions preserve this ordering regardless of the vendor format.
> The other is the syntax most commonly used in practice
It didn’t always used to be this way. In the dark ages before NASM, MASM was a top warez.
And depending on what you’re doing I don’t think Intel syntax is uncommon, gas will even accept it for the most part these days.
> "wait, which version is this? the one that does destination first or destination second?"
There must be some mnemonic to associate sigil vomit with destination last. Shitty sigils come out the ass?