Information Technology Reference
In-Depth Information
Table 2.8 Typical isolated I/O memory map
Address
Device
000h-01Fh
DMA controller
020h-021h
Programmable interrupt controller
040h-05Fh
Counter/Timer
060h-07Fh
Digital I/O
080h-09Fh
DMA controller
0A0h-0BFh
NMI reset
0C0h-0DFh
DMA controller
0E0h-0FFh
Math coprocessor
Hard disk (Secondary IDE drive or CD-ROM drive)
170h-178h
1F0h-1F8h
Hard disk (Primary IDE drive)
200h-20Fh
Game I/O adapter
Expansion unit
210h-217h
278h-27Fh
Second parallel port (LPT2:)
2F8h-2FFh
Second serial port (COM2:)
300h-31Fh
Prototype card
378h-37Fh
Primary parallel port (LPT1:)
380h-38Ch
SDLC interface
3A0h-3AFh
Primary binary synchronous port
3B0h-3BFh
Graphics adapter
3C0h-3DFh
Graphics adapter
3F0h-3F7h
Floppy disk controller
3F8h-3FFh
Primary serial port (COM1:)
Inputting a byte from an I/O port
The assembly language command to input a byte is
IN AL,DX
where DX is the data register which contains the address of the input port. The 8-bit value
loaded from this address is put into the register A
For Turbo/Borland C the equivalent function is inportb() . Its general syntax is as fol-
lows:
value=inportb(PORTADDRESS);
where PORTADDRESS is the address of the input port and value is loaded with the 8-
bit value from this address. This function is prototyped in the header file dos.h .
For Turbo Pascal the equivalent is accessed via the port[] array. Its general syntax is as
follows:
value:=port[PORTADDRESS];
where PORTADDRESS is the address of the input port and value the 8-bit value at this
address. To gain access to this function the statement uses dos requires to be placed
near the top of the program.
Search WWH ::




Custom Search