There are two methods for interfacing memory and I/O devices with a microprocessor: I/O mapped I/O and memory mapped I/O. I/O mapped I/O treats I/O devices and memory separately, while memory mapped I/O treats I/O devices as memory. I/O mapped I/O can use either 8 or 16 address lines, allowing connection of up to 256 fixed I/O devices or 65,536 variable I/O devices. Specific instructions like IN, OUT, and MOV are used to access I/O ports depending on whether it is fixed or variable addressing.
2. Methods of Interfacing
• There are two methods of interfacing memory
or I/O devices with microprocessor
1. I/O mapped I/O
2. Memory mapped I/O
• In I/O mapped I/O, I/O device is treated as a
I/O device and memory as memory.
• In memory mapped I/O, I/O devices are also
treated as memory.
3. I/O mapped I/O
• I/O device is treated as I/O device & memory
as memory
• Each I/O device uses
– either 8 address lines (Fixed port)
– or 16 address lines ( Variable port)
• In fixed port 256 input and 256 output devices
can be connected
• Invariable port, 65,536 input & 65,536 output
devices can be used
4. Instructions used in Fixed type
addressing
• Any address line A0 - A7 or A8 – A15 can be
used.
• A16 - A19 are all 0’s.
• IN AL, 8 bit port address
• IN AX, 8 bit port address
• OUT 8 bit port address, AL
• OUT 8 bit port address, AX
5. Instructions used in Variable type
addressing
• Address lines A0 - A15 are be used.
• A16 - A19 are all 0’s.
• MOV DX, 16bit port address
• IN AL,DX
• IN AX,DX
• OUT DX,AL
• OUT DX,AX