This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calling convention that gets frame pointer register clobbered


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]