Question: 5. int array1[M][N]; int array2[N][M]; int copy(int i, int j) array1[iljlarray20l[i]; Suppose the above code generates the following assembly code (assume array2 and array1 are

 5. int array1[M][N]; int array2[N][M]; int copy(int i, int j) array1[iljlarray20l[i];

5. int array1[M][N]; int array2[N][M]; int copy(int i, int j) array1[iljlarray20l[i]; Suppose the above code generates the following assembly code (assume array2 and array1 are the base addresses of the corresponding arrays and assume that M and N in the above code has been define with #define at the beginning of the program and not shown here): copy: movl %rdi, %ecx movl %rsi, %ebx leal (%ecx,%ecx,8), %edx sall $2, %edx movl %ebx, %eax sall $4, %eax subl %ebx, %eax sall $2, %eax movi array2(%eax,%ecx,4), %eax movl %eax, array1(%edx,%ebx,4) ret What are the values of M and N (4 points)? Show how did you reach your answer (6 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!