Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: port I/O in C

Thread Tools

Re: port I/O in C

Jack Klein
Posts: n/a
On Sun, 06 Jul 2003 02:40:21 GMT, "Kevin Cifuentes"
<(E-Mail Removed)> wrote in comp.lang.c:

> Hey all i need some of your help. I tried compiling this using Dev-C++ and
> at no suprise it gave me an error. I say w/out suprise because I just
> discovered that the _outp and possibly the _inp functions are
> windows-specific in conio.h. I checked in conio.h provided in Dev-C++ and I
> couldn't find the functions anywhere. Do any of you know where I can find a
> header or library that has port I/O specific functions much similar to _inp
> and _outp? Thanx. Here's the code:

There is no such thing as "port I/O" in C. In fact, the language does
not provide any access to hardware at all. And there is no such
header as conio.h in C. If a compiler provides one it is a 100%
completely non-standard extension, and what it might contain is
completely different from one compiler to the next.

> Code:
> #include <time.h>
> #include <conio.h>
> int status;
> if(!m_iNote) return;
> m_iNote = (unsigned)(1193280L / m_iNote);
> _outp(0x43,0xb6);
> _outp(0x42,(char)m_iNote);
> _outp(0x42,(char)(m_iNote >> );
> status = _inp(0x61);
> _outp(0x61,status | 0x03);
> delay( (clock_t)m_iDuration );
> _outp(0x61, status );

As a matter of fact, there is no current marketed Windows operating
system that even allows an application program any access to hardware
ports. The OS will terminate the application the minute it tries to
do so.

But none of this is about C, it is completely about the hardware of
the Intel x86 processors and the Windows operating system. You need
to ask about this in a Windows group, like one of those in the* family.

Jack Klein
Home: http://JK-Technology.Com
FAQs for
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overhead of 4-port over 2-port SRAM John T. Goodman VHDL 0 01-25-2005 04:27 PM
4 port ethernet, 1 port broadband Link Cisco 1 05-09-2004 10:41 PM
Port-security on 16-port FastEthernet module (NM-ESW-16) Dmitry Cisco 0 04-01-2004 06:38 PM
Port security on a Catalyst 4000 - fails to shut down port Jon Whitear Cisco 2 11-04-2003 11:01 PM
about "match ip rtp starting-port-number port-range" Weiguang Shi Cisco 1 10-25-2003 07:14 AM