64 bit mode, inline assembler, "outl %0,%w1" compi
Posted: Tue Feb 19, 2008 1:10 am
wrote the inline assembler in the C code:
void outl(unsigned short port,unsigned long vaule)
{
__asm__ __volatile__ ( "outl %0,%w1" ::"a"(vaule),"d"(port));
}
But issue error when it's compiled.
that prompted, %0 refers "rax".
But the outl instruction only refers 32bit register.
I can modify "outl %0,%w1" to "outl %%eax,%w1".
But I hope use other way to fix it, just like %0 to use the input parameters.
Thanks
void outl(unsigned short port,unsigned long vaule)
{
__asm__ __volatile__ ( "outl %0,%w1" ::"a"(vaule),"d"(port));
}
But issue error when it's compiled.
that prompted, %0 refers "rax".
But the outl instruction only refers 32bit register.
I can modify "outl %0,%w1" to "outl %%eax,%w1".
But I hope use other way to fix it, just like %0 to use the input parameters.
Thanks