Subject: Re: Parallel port programming under Win95
From: [email-masked] (Heinz-Juergen Oertel)

11 Jan 1999 10:30:33 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------76B24069787CCEB0CEC3A341"
To: Jean-Pierre LAMBELIN <[email-masked]>, [email-masked]

This is a multi-part message in MIME format.
--------------76B24069787CCEB0CEC3A341
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

Jean-Pierre LAMBELIN wrote:
> =

> Is-it possible to access the parallel port whith some Cygwin B20 C code=

> under Windows95?
> Under Linux I used   #include <asm/io.h> , ioperm(), outb()...
> I simply want to read or write one byte.
> Some example(s) would be welcome.
> Thanks for your help.
> =

> -
> For help on using this list (especially unsubscribing), send a message =
to
> "[email-masked]" with one line of text: "help".
> =01=01=01=01
> =01=01=01=01
i use the following inline functions to access io ports.
at least it is possible with w98.
don't forget to reserve the io ports in the system folder.

-- =

with best regards / mit freundlichen Gr=FC=DFen

  Heinz-J=FCrgen Oertel

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Heinz-Juergen Oertel
port GmbH            phone +49 3493 743-10
Antonienstr. 3       fax   +49 3493 743-15
D-06749 Bitterfeld   mailto:[email-masked]
Germany              http://www.port.de
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--------------76B24069787CCEB0CEC3A341
Content-Type: text/plain; charset=us-ascii; name="portio.h"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="portio.h"

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

--------------76B24069787CCEB0CEC3A341--

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".