This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: accessing hardware


"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 cygwin-unsubscribe@sourceware.cygnus.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]