Borland C++ reference

inport

raw OCR

Reads a word from a hardware port.

Defined in header <dos.h>

Syntax

#include <dos.h>
int inport(int portid);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

inport works just like the 80x86 instruction IN. It reads the low byte of a word from the input port specified by portid; it reads the high byte from portid +1.

Return value

inport returns the value read.

See also

Example

#include <stdio.h>
#include <dos.h>

int main(void)
{
   int result;
   int port = 0;
   result = inport(port)
printfC'Word 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.