Consider the following source code, where M and N are constants declared with #define: In compiling this

Question:

Consider the following source code, where M and N are constants declared with #define:

long P [M] [N]; long Q[N] [M]; long sum_element (long i, long j) { return P[i] [j] + Q[j] [i]; }

In compiling this program, gcc generates the following assembly code:

1 234 5 6 7 8 9 long sum_element (long i, long j) i in %rdi, j in %rsi sum_element: leaq subq addq leaq addq

Use your reverse engineering skills to determine the values ofM and N based on this assembly code.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Computer Systems A Programmers Perspective

ISBN: 9781292101767

3rd Global Edition

Authors: Randal E. Bryant, David R. O'Hallaron

Question Posted: