Question: 2. (25 points) Analyze assembly program Consider the following code segment. no.w #mya, R14 sub.W R14, R13 R13 7 MyLoop: mov.w R14+, R15 .w R7,

2. (25 points) Analyze assembly program Consider the following code segment. no.w #mya, R14 sub.W R14, R13 R13 7 MyLoop: mov.w R14+, R15 .w R7, R15 10 11 lskip: dec.w R13 12 13 14 15 16 17 mya : dc16 4, 5, 6, -10, ss, 6e, -10e 18 myaa: movW R15, R jnz NyLoop mov.b R7, P10UT Spb R7 mov.b R7, P20UT A. (3 points) How many words is allocated by the assembly directive in line 17? B. (3 points) What is the content of register R13 after the instruction in line 4 is completed? C. (10 points) What does this code segment do? Explain your answer. Hint: what does #0x8000 represent? D. (4 points) What is the value of P1OUT and P2OUT at the end of the program. E. (5 points) Calculate the total execution time in seconds for the code sequence from above (ine 1-line 15) We know the following: the average CPI is 1.8 clocks per instruction. Assume the clock frequency is 1 MHz. What is MIPS rate for this code
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
