Question:

Assuming 3 MHz clock frequency, the execution time taken by the delay subroutine is:
Delay : MVI C, 9Ah
Loop : DCR C
JNZ Loop
RET

Show Hint

The total delay of a loop in microprocessor programming is calculated using Clock Cycles × Time per Cycle. Always consider the number of machine cycles per instruction.
Updated On: Feb 10, 2025
  • 0.723 msec
  • 7.23 msec
  • 0.07231 msec
  • 72.34 \( \mu \)sec
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: The given program executes the following instructions: - MVI C, 9Ah (Immediate Load) → 1 Machine Cycle - DCR C (Decrement C Register) → 1 Machine Cycle per iteration - JNZ Loop (Jump if Not Zero) → 2 Machine Cycles per iteration (except last loop) 
Step 2: The loop executes until C = 0. Given that: \[ C = 9Ah = 154_{10} \] Step 3: The total cycles for the loop: \[ (154 - 1) \times (1 + 2) + 1 = 153 \times 3 + 1 = 460 \text{ cycles} \] Step 4: The system clock is 3 MHz, so: \[ \text{Time per cycle} = \frac{1}{3 \times 10^6} = 0.333 \mu s \] Step 5: The total execution time: \[ T = 460 \times 0.333 \mu s = 0.723 \text{ msec} \] Step 6: Thus, the correct answer is 0.723 mse(C)

Was this answer helpful?
0
0