Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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: 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started