read one byte from an 80x86 hardware port
#include <conio.h> unsigned int inp( int port );
The inp() function reads one byte from the 80x86 hardware port whose number is given by port.
A hardware port is used to communicate with a device. One, two or four bytes can be read and/or written from each port, depending on the hardware. Consult the technical documentation for your computer to determine the port numbers for a device and the expected usage of each port for a device.
When you use the inp() function, your program must be linked for privity level 1, and the process must be run by the superuser or a setuid program that's owned by the superuser but started by a regular user. For more information on privity, see
the byte that was read
inpd(), inpw(), outp(), outpd(), outpw()
#include <conio.h> void main() { /* turn off speaker */ outp( 0x61, inp( 0x61 ) & 0xFC ); }
Intel
All (except DOS/PM)