Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 3 . ( 4 points ) : This problem concerns the indexing of C arrays. Consider the C code below, where N is a

Problem 3.(4 points):
This problem concerns the indexing of C arrays.
Consider the C code below, where N is a constant declared with #define.
int foo (int A[16][N], int i, int j)
{
return A[i][j];
}
Suppose the above C code generates the following assembly code:
foo:
push1%ebp
movl %esp,%ebp
movl 8(%ebp),%ecx
movl 16(%ebp),%edx
movl 12(%ebp),%eax
sal1 $2,%edx
sal1 $3,%eax
subl 12(%ebp),%eax
leal (%edx,%eax, 4),%eax
movl %ebp,%esp
popl % ebp
movl (%ecx,%eax),%eax
ret
What is the value of N?
N=
image text in transcribed

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago

Question

What are the need and importance of training ?

Answered: 1 week ago