On Sun, 06 Jul 2003 02:40:21 GMT, "Kevin Cifuentes"
<> 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
news:comp.os.ms-windows.win32.* family.
--
Jack Klein
Home:
http://JK-Technology.Com
FAQs for
comp.lang.c
http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++
http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
ftp://snurse-l.org/pub/acllc-c++/faq