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


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


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