Calling convention that gets frame pointer register clobbered

Andrew Haley aph@redhat.com
Fri Dec 19 13:14:00 GMT 2003


This is really getting to be off-topic for the gcc developer's list.

Etienne Lorrain writes:
 >     short ret, tmp;
 >     asm (
 > " pushl %es           \n"
 > " int $0x15           \n"
 > " movw %es:3(%bp),%ax \n"
 > " movzbl %ah,%0        \n"
 > " popl %es            \n"
 >         : "=g" (ret), "=a" (tmp)
 >         :
 >         : "ebp"
 >         };
 >     return ret;
 >     }
 >   Does not work if "=g" (ret) is a stack reference because the
 >  stack pointer is modified by push/pop %es - it does work for
 >  anything else.

Why not use "=r" (ret)  ?

Andrew.



More information about the Gcc mailing list