Subject: Re: accessing hardware
From: Heinz-Juergen Oertel <[email-masked]>
To: "'Cygwin mailing list'" <[email-masked]>
Date: Thu, 28 Oct 1999 13:19:51 +0200

"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)
                    );
}

--
Want to unsubscribe from this list?
Send a message to [email-masked]