-1

Calculate the delay calculated by executing the following code by 8085 microprocessor having a clock frequency of 5 MHz

MVI C,08
Loop2: MVI B,09
Loop1 :DCR B
JNZ loop1
DCR C
JNZ loop2
HLT

I am new to microprocessor and I am really finding little difficulty in calculating the delay. Please help!!!

Unn
  • 4,775
  • 18
  • 30

2 Answers2

0

look in the datasheet for the time that each instruction takes and calculate the total number of clock pulses that you need. Then multiply the number of clock pulses with the time that one pulse takes at 5 MHz this would be 250nS.

Dharman
  • 30,962
  • 25
  • 85
  • 135
0

As suggested by @yannik-loroesch you can look at the data sheet to find out the number of T states (clock cycles) required by each of the instructions. Figure out the number of times each statement is excuted by analysing the code and the sum up the total number of T states. Finally multiply it with the amount of time required for each instruction to execute, which is 1/5 µs = 0.2 µs in this case.

You can use simulators like this which shows the T states of each instructions and even counts the total number of T states when the code is executed.

Here the time delay loop has total ((4+10)*10 + 7+4+10)*9 = 1449 T states (excluding the very first and very last statements).

codeR
  • 165
  • 1
  • 1
  • 13