There are three ways of interacting with input/output devices by an application program. One way is through the use of the DOS interrupt service routines. Another way is through the use of the BIOS interrupt service routines. The BIOS and DOS interrupt service routines provide many services that are needed by an application program like reading from the keyboard, displaying to the screen, interacting with the mouse, interacting with the serial and parallel ports.

While the DOS interrupt service routines are standard, the BIOS service routines are not. The specifications of the routines are standard, however their implementation differ from a manufacturer to another. This is because there is no standard for assigning addresses to input/output devices.

It is also possible for an application program to interact directly with input/output devices. This is necessary when there is no such support for the device available either from DOS or BIOS, or when we want a nonstandard access. The various ways of interacting with I/O devices is illustrated below.

Fig. m20010.1 Various ways of interacting with I/O devices

In order to communicate with input/output devices directly, we need to know their assigned addresses and also the protocol of communication with them. Input/Output devices are assigned addresses in the range of the first 64K byte in the same memory address map. In order to distinguish between the addresses used by the I/O devices and those used by the memory, I/O addresses are called ports. Pentium uses a pin to distinguish whether the address is for memory access or I/O device access. The address space can be used for 8-bit, 16-bit, or 32-bit I/O ports.