Borland C++ reference

inpw

raw OCR

Reads a word from a hardware port.

Defined in header <conio.h>

Syntax

#include <conio.h>
unsigned inpw(unsigned  portid);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

inpw is a macro that reads a 16-bit word from the inport port specified by portid. It reads the low byte of the word from portid, and the high byte from portid + 1.

If inpw 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 inpw, you get the inpw function.

Return value

inpw returns the value read.

See also

Example

#include <stdio.h>
#include <conio.h>
int main(void)

   unsigned result;
   unsigned port = 0;
   result = inpw(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.