- 2075 Baisakh · 5 marks
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-cycle | T | A15-A8 | AD7-AD0 | ALE | Control | IO/M S1 S0 |
|---|---|---|---|---|---|---|
| M1 (opcode fetch, 4T) | T1 | 20H | 00H (PCL) | 1 | - | 0 1 1 |
| T2 | 20H | Hi-Z (bus floats) | 0 | RD low | 0 1 1 | |
| T3 | 20H | E6H (opcode in) | 0 | RD low, rises at end | 0 1 1 | |
| T4 | - | - | 0 | none (decode) | 0 1 1 | |
| M2 (memory read, 3T) | T1 | 20H | 01H | 1 | - | 0 1 0 |
| T2 | 20H | Hi-Z (bus floats) | 0 | RD low | 0 1 0 | |
| T3 | 20H | 4BH (data in) | 0 | RD low, rises at end | 0 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
- 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.
- 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)
Related questions
- Machine cycle, T-states, ANI 55H timing · Microprocessor, chapter 2
- Execution of LDA 8B7FH with timing · Microprocessor, chapter 2
- Timing diagram of STA 8050H · Microprocessor, chapter 2
- RIM instruction in 8085 · Microprocessor, chapter 5
- Timing diagram of LDA 2080H · Microprocessor, chapter 2 · asked 2×
- Timing diagram of LXI D, 2465H · Microprocessor, chapter 2 · asked 2×
- 8255 mode 2 operation with timing diagram · Instrumentation II, chapter 2
- Instruction cycle state diagram with interrupt · Computer Organization and Architecture, chapter 1 · asked 6×
- Four-segment instruction pipeline and space-time diagram · Computer Organization and Architecture, chapter 4 · asked 5×
- SISO shift register with timing diagram · Digital Logic, chapter 7 · asked 9×