Question: 5.int array1[M][N]; int array2[N][M]; int copy(int i, int j) array1[i]j array2Ulil: 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[i]j array2Ulil:](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4e0255c701_19666f4e024bee7c.jpg)
5.int array1[M][N]; int array2[N][M]; int copy(int i, int j) array1[i]j array2Ulil: 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
Get step-by-step solutions from verified subject matter experts
