This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Calling convention that gets frame pointer register clobbered
- From: Andrew Haley <aph at redhat dot com>
- To: Etienne Lorrain <etienne_lorrain at yahoo dot fr>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 19 Dec 2003 11:58:17 +0000
- Subject: Re: Calling convention that gets frame pointer register clobbered
- References: <20031219114307.78240.qmail@web11805.mail.yahoo.com>
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.