On a typical microprocessor, a distinct I/O address is used to refer to the I/O data registers and a distinct address for the co
ntrol and status registers in an I/O controller for a given device. Such registers are referred to as ports. In the Intel 8088, two I/O instruction formats are used. In one format, the 8-bit opcode specifies an I/O operation; this is followed by an 8-bit port address. Other I/O opcodes imply that the port address is in the 16-bit DX register. How many ports can the 8088 address in each I/O addressing mode?
For the first instruction format, we have eight bits for port addressing, therefore, the number of port addressed can be calculated as 2^8 = 256 ports
For the second instruction format, we have sixteen bits for addressing, therefore, the number of ports addressed can be calculated as 2^16 = 65536 ports
The opcode selection allows us to change between the first and second instruction format, an opcode allows one input or output operation at a time.