0

Simple question. I doubt this will receive much attention, but how do I do 3 or 4 parameter operations in x86-64 assembly in AT&T (gAS) syntax? It's known to any x86 programmer using gAS that the arguments are switched, for example:

xor   eax,  ebx ; Intel (xASM)
xorl %ebx, %eax ; AT&T (gAS)

But how would I do, say:

blendpd xmm0, xmm1, 5

What I mean is, how are the instructions written? I get that there would be %xmm0 and such (still prefixes on parameters), but how are they ordered and what suffix do I add at the end of the instruction (the l in movl for 32-bit)?

Cole Tobin
  • 9,206
  • 15
  • 49
  • 74

1 Answers1

4

The AT&T equivalent would be where the order of operands is reversed:

blendpd $5, %xmm1, %xmm0

If you are unsure you can always compile with Intel syntax then disassemble to AT&T.

Mike Kwan
  • 24,123
  • 12
  • 63
  • 96
  • Plus, where's the suffix on the instruction? – Cole Tobin Dec 17 '12 at 17:25
  • 1
    The suffix is not necessary since the size can be inferred from the destination. You can disassemble to AT&T syntax with `objdump -Dslx BINARY`. Or look at the assembly stage with `gcc -S` (not sure what compiler you are using). – Mike Kwan Dec 17 '12 at 17:28
  • 1
    See [Instruction Naming](http://sourceware.org/binutils/docs/as/i386_002dMnemonics.html). – Mike Kwan Dec 17 '12 at 17:44