Borland C++ reference

inportb

raw OCR

Reads a byte from a hardware port.

Defined in header <dos.h>

Syntax

#include <dos.h>
unsigned  char inportb(int portid);

Portability

DOSUNIXWindowsANSI CC++ only
■■

Remarks

inportb is a macro that reads a byte from the input port specified by portid.

If inportb is called when dos.h has been included, it will be treated as a macro that expands to inline code. If you don't include dos.h, or if you do include dos.h and #undef the macro inportb, you get the inportb function.

Return value

inportb returns the value read.

See also

Example

#include <stdio.h>
#include <dos.h>
int main(void)
{
   unsigned char result;
   int port = 0;
   result = inportb (port);
   printf("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.