In the GNU manual it states that gcc is based not on the Intel assembly language, but rather on a language that descends from the AT&T Unix assembler. There are two main camps on assembly syntax:
- Intel:
opcode dest, src
- AT&T:
opcode src, dest
In your example you're using AT&T syntax, the default. However, if you prefer to switch to Intel syntax, you can either compile with -masm=intel
or use the following:
__asm__(".intel_syntax;" ...);
You can find more discussions of that topic in this or this Stackoverflow thread, or read more here.