📝 I/O Mapped I/O or Isolated I/O in 8085 Microprocessor (10 MCQs)
Separate Address Space for Isolated Input and Output Devices
Isolated I/O, also called I/O-mapped I/O, provides a separate address space for communicating with peripheral devices in an 8085-based system. It uses eight-bit port addresses, allowing up to 256 distinct port addresses. Unlike memory-mapped I/O, these ports are accessed through dedicated input and output instructions rather than ordinary memory instructions.
Eight-Bit Port Address and I/O Control Organization
The IN and OUT instructions contain an eight-bit port address following the opcode. During an I/O operation, IO/M becomes high to identify peripheral access. The processor uses RD or WR together with IO/M, and external decoding logic generates the appropriate I/O read or write control signal for the selected device.
Port Selection and Data Transfer Sequence
During IN, the processor presents the port address and activates the read control for the selected input interface. The peripheral places its eight-bit value on the data bus, and the accumulator receives it. During OUT, accumulator contents are supplied to the selected port while the write control enables the peripheral to capture the byte.
Example of Reading from an Isolated Input Port
Consider IN 80H. The processor fetches the instruction, obtains the port address 80H and initiates an I/O read cycle. If the selected input device supplies 5AH, the accumulator receives 5AH. This operation uses an eight-bit port address and does not access memory location 0080H.
Comparison with Memory-Mapped Input and Output
Isolated I/O preserves the complete 64 KB memory address space because peripheral ports use separate addressing. However, the eight-bit port range limits the number of directly addressable port locations. Memory-mapped I/O provides sixteen-bit addresses and permits ordinary memory instructions, whereas isolated I/O requires IN and OUT instructions.
Misconceptions About Isolated I/O Addressing
'IN 80H reads memory location 0080H' is incorrect because 80H identifies an I/O port. 'IO/M is low during an I/O read' is incorrect because high indicates isolated I/O. 'Isolated I/O provides 65,536 ports' overlooks its eight-bit port-address limitation of 256 addresses.
I/O Port Addressing and Instruction Examination Questions
Understand the eight-bit port-address range from 00H to FFH and identify IN and OUT instruction formats. Distinguish memory-read cycles from I/O-read cycles using IO/M. Practise tracing accumulator transfers and comparing the address-space requirements, instruction availability and decoding arrangements of isolated and memory-mapped I/O.
Isolated I/O and Port-Addressing Terms
- Isolated I/O - Uses a separate peripheral address space.
- IN - Reads data from an input port.
- OUT - Sends accumulator data to an output port.
- Port Address - Identifies an individual I/O port.
- IO/M - Identifies memory or I/O operations.
- I/O Decoder - Selects the addressed peripheral.
📝 All I/O Mapped I/O or Isolated I/O in 8085 Microprocessor MCQs
Q1. Given N = 03H stored at 2100H and the three bytes 34H, A5H, 00H at addresses 2101H-2103H (LSB at 2101H), after the program finishes, what value will be stored at memory location 2202H?
📖 Explanation: The program first complements 34H, adds 1, and stores 0xCC at 2201H. The carry generated is cleared, so B is set to 00H. For the second byte A5H, CMA produces 0x5A, and because the previous carry is 0, the ADD B step adds 0, yielding 0x5A which is stored at 2202H. Thus the middle byte of the two’s‑complement result is 5AH. All other options represent either the original byte or the high‑order byte, not the correct middle result.
Q2. To modify the program so it produces the 1's complement of each byte instead of the 2's complement, which instruction should be replaced?
📖 Explanation: The two’s complement is obtained by complementing the bits (CMA) and then adding one (ADI 01H). To generate only the one’s complement, the addition of one must be omitted. Replacing the ADI 01H instruction with a NOP (or removing it) leaves the program performing only the CMA step, which yields the one’s complement of each byte. Changing CMA, STAX D, or the jump instructions would not eliminate the extra increment, so only option B correctly modifies the algorithm.
Q3. If the carry flag is set after processing the first byte, what value is loaded into register B for the next iteration?
📖 Explanation: After processing the first byte, the program tests the carry flag with JNC. If the carry is set, it executes the path that loads 01H into register B (MVI B,01H). This value is then used in the subsequent ADD B instruction to propagate the carry into the next byte’s two’s complement calculation. Therefore, when the carry flag is set, B receives 01H, while the other options either clear the carry or are unrelated.
Q4. When N = FFH (255 bytes), which of the following problems is most likely to occur because the program does not check the end of memory space?
📖 Explanation: The program assumes that the destination area beginning at 2201H has enough space for N bytes. When N = FFH, the program will write up to address 2200H + FFH = 22FFH. If the system’s RAM ends before this address, the final writes will overwrite whatever follows, possibly corrupting other variables or program code. This overflow does not affect the stack or carry flag, and the 8085 does not have unlimited memory, making option A the realistic consequence.
Q5. If the system uses isolated I/O instead of memory‑mapped I/O, which instruction in the program will fail to access the peripheral correctly?
📖 Explanation: In isolated I/O, peripheral devices are accessed with the IN and OUT instructions using port numbers, not through ordinary memory addresses. The program stores results with STAX D, which writes to the memory location pointed to by the D‑E pair. If the destination were intended to be an I/O port, STAX D would attempt a memory write and the peripheral would not receive the data. Hence the instruction that would fail under isolated I/O is the store operation, option B.
Q6. Why does the program use the sequence CMA followed by ADI 01H to obtain the 2's complement rather than using a single SUB instruction on the accumulator?
📖 Explanation: The sequence CMA followed by ADI 01H first produces the one’s complement and then adds one, which is the standard method for obtaining a two’s complement. Using SUB would require the accumulator to contain zero and subtract the original value, but this does not set the carry flag correctly for multi‑byte propagation. The chosen method ensures that the carry generated after adding one is captured and forwarded to the next byte via register B, making option A the accurate reason.
Q7. In the program, the source address is held in the H‑L pair while the destination address is held in the D‑E pair. How does this use of separate register pairs illustrate the concept of isolated I/O?
📖 Explanation: Isolated I/O separates the address spaces for memory and I/O devices. By keeping the source address in the H‑L pair and the destination address in the D‑E pair, the program demonstrates how two distinct address registers can be used to access different regions without mixing them. This mirrors the concept that I/O ports can be addressed independently from memory, which is why option B correctly describes the illustration of separate address spaces.
Q8. Which statement best explains why a designer might choose isolated I/O over I/O‑mapped I/O for a peripheral that requires slower access times on an 8085 system?
📖 Explanation: Isolated I/O uses dedicated IN and OUT instructions that operate on port numbers rather than memory addresses, allowing designers to control the timing of I/O cycles separately from memory cycles. For a peripheral that requires slower access, this separation lets the system insert wait states or slower clocking without affecting memory performance. Options B, C, and D contain inaccurate statements about speed or compatibility, while option A correctly explains the timing advantage of isolated I/O.
Q9. When computing the multi‑byte 2's complement, the program uses JNC to decide whether to set the carry flag in register B. What would be the effect of replacing JNC with JC?
📖 Explanation: The JNC instruction jumps when the carry flag is not set, meaning that a zero carry leads to a path where B is loaded with 00H. Replacing JNC with JC would cause the program to load B with 01H when there is **no** carry, reversing the intended propagation logic. This would add an unwanted carry to the next byte, producing an incorrect two’s complement result. Therefore, the effect described in option A accurately reflects the consequence of such a change.
Q10. What is the 8085 mnemonic for loading the immediate value 01H into register B?
📖 Explanation: The 8085 instruction that loads an immediate 8‑bit constant into register B is the Move Immediate (MVI) mnemonic. The syntax is “MVI B, 01H”, which places the value 01H directly into B. LXI loads a register pair, MOV copies between registers, and ADI adds an immediate to the accumulator, none of which perform a direct immediate load into B. Hence option A is correct.