I think your problem is that there are two different ways to write an x86 assembly. One is AT&T notation, and the other is Intel notation. The order of arguments for the command is canceled in Intel notation, unlike AT & T. Your assembly version is displayed in Intel notation, which means that mov esp, ebp actaully moves the value in ebp to esp . In a more logical (in my opinion) AT & T notation would be mov %ebp, %esp .
Abhay Buch Mar 29 '11 at 2:47 a.m. 2011-03-29 14:47
source share