Help 64bit:The AT&T style assembler, inl&outl instru

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
rjying
Posts: 22
Joined: Tue Jan 15, 2008 12:52 am

Help 64bit:The AT&T style assembler, inl&outl instru

Post by rjying »

In the 64bit mode, The inl & outl instructions will be expanded 64bit input and
output operate.
What instructions to be used 32bit input and output operate?

Does inb&outb always 8 bit input&output operate?
Does inw&outw always 16bit input&output operate?
Thanks
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

In long mode, you do not get additional 64 bit inputs and outputs - inputs are zero extended to 64 bits and outputs ignore the higher 64 bits of a 64 bit register.

Cheers,
Adam
User avatar
rjying
Posts: 22
Joined: Tue Jan 15, 2008 12:52 am

Post by rjying »

Thank you very much.
I 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".

Thanks.
Post Reply