Question: 2. (25 points) Analyze assembly program Consider the following code segment. 01 CLR R12 02 MOV.W myw, R6 03 MOV.W #1, R5 04 MOV.W #16,
2. (25 points) Analyze assembly program Consider the following code segment. 01 CLR R12 02 MOV.W myw, R6 03 MOV.W #1, R5 04 MOV.W #16, R7 05 Inxt: BIT.W R5, R6 06 JNZ lskip 07 INC.W R12 08 Iskip: RRA.W R6 09 DEC.W R7 10 JNZ lnxt 11 MOV.B R12, PLOUT 12 .word 1011110110011110b ; suffix b denotes binary value A. (3 points) How many bytes are allocated by the assembly directive in line 13 and what is the content of memory location at myw in hexadecimal? 13 myw: B. (3 points) What is the content of register R6 after the instruction in line 02 is completed? C. (10 points) What does this code segment do? Explain your answer. D. (4 points) What is the value of P1OUT at the end of the program. E. (5 points) Calculate the total execution time in seconds for the code sequence from above (line 1 - line 11). We know the following: the average CPI is 2 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
