Giving up on AT&T style assembler syntax
Until recently I had been pretty agnostic about Intel vs. AT&T style assembler syntax. I always noticed that people who had a strong opinion almost always preferred Intel-style, but I didn’t care too much one way or the other.
gcc was my first real compiler, and this was back before binutils supported Intel syntax like they do now. So I read Brennan’s Guide to Inline Assembly (which I still reference frequently), and didn’t worry too much about it.
One thing that always bugged me a little bit was how the instruction names weren’t exactly the same. AT&T made you put these suffixes on your instructions, so mov would become movl. The main problem with this is Googleability.
But today what was previously an annoyance reached the level of being a serious problem. I was looking at an instruction listing and saw the instruction movslq. First I Googled for movsl (presuming that the “q” was a “quadword” suffix), but that yielded nothing. Then I tried Googling for movslq in its entirety, still nothing that seemed to define the instruction.
When I did follow the link, what I discovered is that movslq in AT&T syntax corresponds to movsxd in Intel syntax. The moment I discovered this, it became quite clear to me that AT&T syntax was a dead end. “-M intel” will be my default parameter to objdump from now on.
Recent Comments