Please help me with this problem In the following assume a 16 MHz instruction cl
ID: 2248382 • Letter: P
Question
Please help me with this problem
In the following assume a 16 MHz instruction clock. (a) For the following code fragement, what is the final value of w2? mov #100, w2 repeat w2 dec 2, 2 (b) How long does the code fragment in (a) take to execute? (c) Assume w14 contains 0x200, and the four sequential addresses of data memory bytes, starting at address 0x200, contain 0x0a, 0x00, 0x14, contain 0x10. Immediately after this code executes what will be the values of w0, w1, w14, and these four sequential memory addresses?Explanation / Answer
Answer
a) w2 will be having -1 as final value.
explanation:
In the given instructions
mov #100,w2 // this will load register w2 with value 100
repeat w2 // as w2 is now having value 100, the next instruction will be reppeated for w2+1 times ,(101 times)
dec w2,w2 // it will decrement w2 by one and result will be stored in w2, this will be executed for 101 times
b) each instruction takes one instruction clock time
therefore
total time taken will be 103 * 0.0625 usec. = 6.43 usec
c) please provide code for this problem
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.