Skip to main content

Bus timing of OUT 42H

Short answer

OUT 42H outputs accumulator to port 42H. It has opcode fetch (4T), memory read of the port address (3T), and I/O write (3T) = 10 T-states. In I/O write, address 42H appears on A15–A8 and AD7–AD0, WR goes low, and accumulator data is sent.

Draw and explain the bus timing for OUT 42H instruction of 8085 microprocessor.

OUT 42H (opcode D3H) sends the content of the accumulator to the output port whose 8-bit address is 42H. It is a 2-byte instruction with 3 machine cycles: opcode fetch (4T), memory read (3T), I/O write (3T) = 10 T-states. Assume it is stored at 2000H, 2001H.

M-cycleTA15-A8AD7-AD0ALEControlIO/M S1 S0
M1 (opcode fetch, 4T)T120H00H (PCL)1-0 1 1
T220HHi-Z (bus floats)0RD low0 1 1
T320HD3H (opcode in)0RD low, rises at end0 1 1
T4--0none (decode)0 1 1
M2 (memory read, 3T)T120H01H1-0 1 0
T220HHi-Z (bus floats)0RD low0 1 0
T320H42H (data in)0RD low, rises at end0 1 0
M3 (I/O write, 3T)T142H42H1-1 0 1
T242HA (data out)0WR low1 0 1
T342HA0WR low, rises at end1 0 1
      |  M1 (OF)  | M2 (MR) | M3 (IOW)|
      |T1 T2 T3 T4|T1 T2 T3 |T1 T2 T3 |
 ALE  |HI lo lo lo|HI lo lo |HI lo lo |
 RD   |hi LO LO hi|hi LO LO |hi hi hi |
 WR   |hi hi hi hi|hi hi hi |hi LO LO |
 IO/M |lo lo lo lo|lo lo lo |HI HI HI |

Explanation

  1. M1 (opcode fetch): address 2000H on the bus, ALE = 1 in T1, IO/M = 0, S1 = S0 = 1. RD goes low in T2-T3 and D3H is read into IR; decoded in T4.
  2. M2 (memory read): address 2001H; RD low; the port address 42H is read into registers W and Z.
  3. M3 (I/O write): IO/M goes high (I/O operation), S1 = 0, S0 = 1. The 8-bit port address 42H is placed on both A15-A8 and AD7-AD0 in T1 (ALE = 1). In T2 the content of A is put on AD7-AD0 and WR goes low; the port latches the data when WR goes high at the end of T3.

Total = 4 + 3 + 3 = 10 T-states. Memory is not accessed in the third cycle because IO/M = 1.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 2 questions →