accessing hardware
Heinz-Juergen Oertel
oe@port.de
Sun Oct 31 19:54:00 GMT 1999
"Schmidt, Dieter" wrote:
>
> Dear Sirs and Madams,
>
> I want to adress hardware in my PC using the cygwin-compiler.
> Is there any instruction like outputb(word,byte) in the Turbo C
> compiler available in cygwin ?
>
> Yours sincerely
>
> Dieter Schmidt
try this
--
Heinz
/* port io functions for gcc or egcs - useable for Cygwin targets */
static inline int inportb( int port )
{
unsigned char value;
__asm__ volatile ("inb %1,%0"
: "=a" (value)
: "d" ((unsigned short)port));
return value;
}
static inline void outportb( unsigned short int port, unsigned char val )
{
__asm__ volatile (
"outb %0,%1\n"
:
: "a" (val), "d" (port)
);
}
More information about the Cygwin
mailing list