Question 3.5: Find the size of the delay in following program, if the crys...

Find the size of the delay in following program, if the crystal
frequency is 11.0592MHz.

Machine Cycle

DELAY:        MOV   R2,#200                                                                                                                                           1
AGAIN:        MOV   R3,#250                                                                                                                                            1
HERE:          NOP                                                                                                                                                              1

NOP                                                                                                                                                              1
DJNZ   R3,HERE                                                                                                                                         2
DJNZ   R2,AGAIN                                                                                                                                       2
RET^{\nearrow ^{\text{Notice in nested loop, as in all other time delay loops, the time is approximate since we have ignored the first and last instructions in the subroutine.} } }              2

The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.

For HERE loop, we have (4×250) x1.085 μs=1085μs.
For AGAIN loop repeats HERE loop 200 times, so we have 200×1085 μs=217000 μs. But “MOV R3,#250” and “DJNZ R2,AGAIN” at the start and end of the AGAIN loop add (3x200x1.805)=651 μs.
As a result we have 217000 + 651= 217651 μs.

Related Answered Questions

Question: 3.1

Verified Answer:

11.0592/12 = 921.6 kHz; machine cycle is 1/921.6 k...