I/O and The 8255 Isa Bus Interfacing
I/O and The 8255 Isa Bus Interfacing
INTERFACING
MOV
IN
DX,port#
AL,DX
MOV
OUT
DX,port#
DX,AL
Inputting Data
Outputting Data
Format: IN
dest, source OUT dest,source
(1)
IN
AL,port#
OUT port#,AL
port# is the address of the port and can be from 00 to
FFH.
This 8-bit address allows 256 input ports and 256 output
ports.
In this format, the 8-bit port address is carried on
address bus A0 - A7.
Format:
Outputting Data
Inputting Data
(2)
MOV DX,port#
MOV DX,port#
IN
AL,DX
OUT DX,AL
port# is also the address of the port, except that
it can be from 0000 to FFFFH, allowing up to
65,536 input and 65,536 output ports.
The 16-bit port address is carried on address
bus A0 A15
The use of a register as a pointer for the port
address has an advantage in that the port
address can be changed very easily, especially
in cases of dynamic compilations where the port
address can be passed to DX.
MOV
IN
DX,port#
AX,DX
MOV
OUT
DX,port#
DX,AX
;AL=36H
;send value 36H to port address 43H
0 px
A tri-state buffer is
internal and therefore
invisible.
For the simple input ports
we use the 74LS244 chip.
See Figure 11-4.
Notice that since 1G and
2G each control only 4
bits of the 74LS244, they
both must be activated for
the 8-bit input
Table 11-1 I/O Map for the x86 PC (See Appendix G for Further Details)
0 1
= 83H
CS
A1
A0
Selects
Port A
Port B
Port C
Control Register
(b) Find the control byte (word) for this configuration. Port A
as input, B as output, and all the bits of port C as output.
Solution:
(b) The control word is 90H, or 1001 0000.
1 0 0 1 0 0 0 0 = 90H