Reputation: 831
I am running a 32 bit C application on 64 bit SUSE Linux. I just disassembled one of its function in gdb and I see the below assembly at function start i.e. function prologue:
0x08048c0e <+0>: push %ebp
0x08048c0f <+1>: mov %esp,%ebp
Assembly instruction mov instruction syntax I guess is:
mov <Destination>, <Source>
But seeing the assembly code above this seems changed to
mov <Source>, <Destination>
Is the syntax of assembly instructions processor dependent?
Upvotes: 0
Views: 80
Reputation: 16331
What you describe as your expectation is known generally as "Intel" syntax while your disassembly i being displayed in AT&T format.
If you are using GDB, you can execute a set disassembly-flavor intel
command to change it over. In fact, you can even put this into a .gdbinit
file in the local directory where you are debugging or, if you want it more generally configured, in your home directory. It will then be set automatically.
Upvotes: 1