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: kaih at khms dot westfalen dot de (Kai Henningsen)
- To: etienne_lorrain at yahoo dot fr
- Cc: gcc at gcc dot gnu dot org
- Date: 22 Dec 2003 12:48:00 +0200
- Subject: Re: Calling convention that gets frame pointer register clobbered
- Comment: Unsolicited commercial mail will incur an US$100 handling fee per received mail.
- Organization: Organisation? Me?! Are you kidding?
- References: <20031222105958.13221.qmail@web11801.mail.yahoo.com>
etienne_lorrain@yahoo.fr (Etienne Lorrain) wrote on 22.12.03 in <20031222105958.13221.qmail@web11801.mail.yahoo.com>:
> unsigned char
> _EBIOSDISK_getparam (unsigned char disk, ebiosinfo_t *ebiosinfo,
> unsigned char *status)
> {
> unsigned char carry;
>
> asm (
> " int $0x13 # _EBIOSDISK_getparam \n"
> " mov %%ah,%1 \n"
> " setc %0 \n"
> : "=qm" (carry), "=qm" (*status), "=S" (*ebiosinfo)
> : "a"((unsigned short)0x4800), "d" (disk)
> );
>
> return carry;
> }
> Using output "=m" (*ebiosinfo) and input "S" (ebiosinfo) is not
> completely equivalent because the output part may generate strange
> code on some compiler version - but that is the best approximation.
In any case, that's where your error is. You're claiming to move the whole
structure when actually you're only trying to move the pointer.
Don't lie to the compiler, or the compiler will bite you.
MfG Kai