Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve in an hour Assembly Matrix Question: (10 points) Your task is to figure out the values of the P and Q macros that

please solve in an hourimage text in transcribed

Assembly Matrix Question: (10 points) Your task is to figure out the values of the P and Q macros that have been defined and control the size of the array matrix (double array). Note that the values have been changed from the j.c code and you need to derive the values by reading the assembly code that is given below. We will first show the C code and then the assembly that was generated. This C code: #define P ? #define Q? int mat1[P][Q]; int mat2[Q][P]; void copy_element( int i, int j) { mat1[ i ][ j ] = mat2[ 3 ][ i]; } Is translated into the following X86-64 Assembly: copy_element: movslq %edi, %rdi movslq %esi, %rsi leaq (%rsi, %rsi,2), %rdx leaq (%rdx, %rdx), %rax addq %rdi, %rax movt mat2C, %rax,4), %ecx leaq (%rdi, %rdi,4), %rax (%rdi,%rax,2), %rdx (%rdx, %rdx), %rax adda %rax, %rsi moyl %ecx, mat1(,%rsi,4) ret leaq leaq Your task is to figure out the size of the arrays. What is the value of P? |

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

Step: 3

blur-text-image

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

Database Reliability Engineering Designing And Operating Resilient Database Systems

Authors: Laine Campbell, Charity Majors

1st Edition

978-1491925942

More Books

Students also viewed these Databases questions

Question

Evaluate three pros and three cons of e-prescribing

Answered: 1 week ago

Question

=+ Why have these changes occurred?

Answered: 1 week ago

Question

=+90 percent of all oil refineries) into several smaller companies

Answered: 1 week ago