inp
raw OCR
Reads a byte from a hardware port.
Defined in header <conio.h>
Syntax
#include <conio.h>
int inp(unsigned portid);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
inp is a macro that reads a byte from the input port specified by portid.
If inp is called when conio.h has been included, it will be treated as a macro that expands to inline code. If you don't include conio.h, or if you do include conio.h and #undef the macro inp, you get the inp function.
Return value
inp returns the value read.
See also
Example
#include <stdio.h>
#include <conio.h>
int main(void)
{
int result;
unsigned port = 0;
result = inp(port);
printfC'Byte read from port %d = Ox%X\n", port, result);
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Stable link: /3.1/conio.h/inp/
· short form /3.1/inp/