----Original Message---- >From: patriciak784-gccmainling >Sent: 20 September 2005 12:15
> On x86 and GCC 3.4.2, the resulting asm code when > leaving a stackframe is (in intel_syntax) > mov esp,ebp > pop ebp > .(results in 0x89EC5D or 0x8BE55D) > The AMD optimisation guide for AMD64 tells you not to > use mov esp, ebp - pop ebp but to use "leave"(just > 0xC9)! I don't have a 64bit version, but did you try using the appropriate -march= option? [EMAIL PROTECTED] /test/leave> cat foo.c int foo (void) { return 9; } [EMAIL PROTECTED] /test/leave> gcc -O0 -S foo.c -o foo.s [EMAIL PROTECTED] /test/leave> cat foo.s .file "foo.c" .text .globl _foo .def _foo; .scl 2; .type 32; .endef _foo: pushl %ebp movl %esp, %ebp movl $9, %eax popl %ebp ret [EMAIL PROTECTED] /test/leave> gcc -O0 -S -march=athlon-xp foo.c -o foo.s [EMAIL PROTECTED] /test/leave> cat foo.s .file "foo.c" .text .globl _foo .def _foo; .scl 2; .type 32; .endef _foo: pushl %ebp movl %esp, %ebp movl $9, %eax leave ret [EMAIL PROTECTED] /test/leave> cheers, DaveK -- Can't think of a witty .sigline today....