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.