Question: You are given this ARM assembly code loop initiation code MOV r0,#0 ; use r0 for i, set to 0 MOV r8,#0 ; use a

You are given this ARM assembly code loop initiation code MOV r0,#0 ; use r0 for i, set to 0 MOV r8,#0 ; use a separate index for arrays ADR r2,N LDR r,[r2]; get value of N MOV r2,#0 ; use r2 for f, set to 0 ADR r3.c; load r3 with address of base of c ADR r5,x ; load r5 with address of base of x ; test for exit CMP r0,rl BGE loopend get address for N ; if I >= N, exit loop loop body LDR r4,[r3; get value of c[i] LDR r6,[r5; get value of MULt4x4x6 ; compute c[i]*x[i] ADD r2,r2,r4; add into running sum , update ADD r818,#4 ; add one to array index ADD rO.r0,#1 ; add 1 to i B loop loopend loop Assume that load/store instructions execute in three cycles, branch instructions require one cycle if not taken/three if taken, all other instructions execute in one cycle. Find the total execution time of this code for N=3 You are given this ARM assembly code loop initiation code MOV r0,#0 ; use r0 for i, set to 0 MOV r8,#0 ; use a separate index for arrays ADR r2,N LDR r,[r2]; get value of N MOV r2,#0 ; use r2 for f, set to 0 ADR r3.c; load r3 with address of base of c ADR r5,x ; load r5 with address of base of x ; test for exit CMP r0,rl BGE loopend get address for N ; if I >= N, exit loop loop body LDR r4,[r3; get value of c[i] LDR r6,[r5; get value of MULt4x4x6 ; compute c[i]*x[i] ADD r2,r2,r4; add into running sum , update ADD r818,#4 ; add one to array index ADD rO.r0,#1 ; add 1 to i B loop loopend loop Assume that load/store instructions execute in three cycles, branch instructions require one cycle if not taken/three if taken, all other instructions execute in one cycle. Find the total execution time of this code for N=3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
