Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the source code below, where M and N are constants declared with #define. #define M (secret) #define N (secret) int mat1[MJIN]: int mat2[ N

image text in transcribed

Consider the source code below, where M and N are constants declared with #define. #define M (secret) #define N (secret) int mat1[MJIN]: int mat2[ N JI M: void copy_element(int i, int j) mat1[ i ][ j ]=mat2[ j ][i]; This generates the following assembly code copy_element: movs1q movs1q leaq salq addq movi leaq %edi, %rdi %esi,Arsi (Arsi,Arsi,4), $2,Arax %rdi, %rax mat2(,%rax,4), (%rdi,%rdi,4), %rax %eax %rdx addq movl ret %rdx, %eax, Arsi mat1(,Arsi,4) What are the values of N and M N: M: Consider the source code below, where M and N are constants declared with #define. #define M (secret) #define N (secret) int mat1[MJIN]: int mat2[ N JI M: void copy_element(int i, int j) mat1[ i ][ j ]=mat2[ j ][i]; This generates the following assembly code copy_element: movs1q movs1q leaq salq addq movi leaq %edi, %rdi %esi,Arsi (Arsi,Arsi,4), $2,Arax %rdi, %rax mat2(,%rax,4), (%rdi,%rdi,4), %rax %eax %rdx addq movl ret %rdx, %eax, Arsi mat1(,Arsi,4) What are the values of N and M N: M

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3. Evaluate a Web-based training site.

Answered: 1 week ago