Question: The subroutine delay sub uses a simple loop to implement a delay. The assembly listing of this subroutine is 0 0 0 0 0 2
The subroutine delay sub uses a simple loop to implement a delay. The
assembly listing of this subroutine is
f :
f: mov.w count, w
f: f ff f mov.w #xffff w
f :
f: add.w w w w
fa: nop
fc: fd ff a bra NZxf
fe: return
Assume an instruction frequency of MHz for an an instruction cycle time of ns
a How many bytes of program memory does this subroutine, delay sub, occupy? How many
bytes of data memory are used?
Program memory bytes, Data memory bytes.
b What value should be used for the variable count if the delay is to be as close as possible to
but no greater than, ms Complete the following to initialize count with this value.
data
count: word
c To make this delay exactly ms we may need to add nop instructions Where in the code
and how many nop instructions, if any, should be added
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
