Re: inb

Herbert Poetzl <[email protected]>
Newsgroups org.kernel.vger.linux-assembly
Message-ID <[email protected]>
On Sat, Jun 11, 2005 at 02:18:25PM +0000, Martin Fflores wrote:
> hi! everyone, i have a little problem with the extended assembly, when i 
> try to compile this:
> __asm__ __volatile__("inb %1,%0;":"=r"(returned):"r"(port));
> it makes a error layout, if instead i write :
> __asm__ __volatile("inb $0x64,%0;":"=r"(returned));
> its work right; So how i can make a macro that recibe a port value or 
> argumen like the first example???
> i wan to write in any port not a const value;
> 
> i hope you can help, i'm so coriosus abpout all this things of linux.
> Sorry abour my english

int     _inb(int port)
{
        unsigned char ret;
        __asm__ __volatile__ ("inb %w1,%0":"=a"(ret):"id"(port));
        return ret;
}

best,
Herbert

> Martin Flores.
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE! 
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-assembly" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.