Search code examples
assemblyx86gnu-assembleratt

What is the AT&T / GAS syntax for mulx?


The Wikibooks x86 Assembly says:

GAS instructions generally have the form mnemonic source, destination. For instance, the following mov instruction:

But it does not say what exceptions to this rule are, and I cannot find a table of instructions. The official AS documentation doesn't seem to have a section that gives syntax for all the instructions (though it's pretty long, and I might have just missed the section). The normal x86 reference that I use for instructions doesn't obviously specify the dialect, though, and it has the arguments in destination, source order.

What's the syntax for mulx in GAS / AT&T, and is there a reference that I can use to easily look up such things in the future?


Solution

  • This wikibook: https://en.wikibooks.org/wiki/X86_Assembly/Arithmetic

    doesn't include MULX, but it does show the 3 operand IMUL instruction listed as such:

    imul    dest, src, aux                  (Intel syntax)
    imul    aux, src, dest                  (GAS Syntax)
    

    so MULX would be:

    mulx    dest_hi, dest_lo, src1          (Intel syntax)
    mulx    src1, dest_lo, dest_hi          (GAS Syntax)