Skip to main content

Execution of ANI 4BH with timing

Short answer

ANI 4BH ANDs accumulator with immediate byte 4BH, result in A. It sets AC=1, CY=0, and S, Z, P per result. The 2-byte instruction has opcode fetch (4T) and memory read (3T), total 7 T-states.

Explain the execution of instruction ANI 4BH in 8085 with the help of timing diagram.

ANI 4BH (opcode E6H) ANDs the accumulator with the immediate byte 4BH and stores the result in A: A <- A AND 4BH. It sets AC = 1, clears CY, and sets S, Z, P by the result. It is a 2-byte instruction with 2 machine cycles: opcode fetch (4T) and memory read (3T) = 7 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
T320HE6H (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
T320H4BH (data in)0RD low, rises at end0 1 0
      |  M1 (OF)  | M2 (MR) |
      |T1 T2 T3 T4|T1 T2 T3 |
 ALE  |HI lo lo lo|HI lo lo |
 RD   |hi LO LO hi|hi LO LO |
 WR   |hi hi hi hi|hi hi hi |

Explanation

  1. M1: PC = 2000H on the bus with ALE = 1 in T1. RD low in T2-T3; opcode E6H is read into IR. In T4 it is decoded and the CPU knows one more byte is needed.
  2. M2: PC = 2001H on the bus; RD low; the data byte 4BH is read into a temporary register. At the end of this cycle the ALU performs A AND 4BH and the result goes back to A.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 2 questions →