Question: In the following code, we have omitted the definitions of constants M and N: We compiled this code for particular values of M and N.

In the following code, we have omitted the definitions of constants M and N:

#define M #define N /* Mystery number 1 */ /* Mystery number 2 */ int arith (int x, int y) { int result = 0;

We compiled this code for particular values of M and N. The compiler optimized the multiplication and division using the methods we have discussed. The following is a translation of the generated machine code back into C:

/* Translation of assembly code for arith */ int optarith (int x, int y) { int t = x; } x < >= 3; /*

What are the values of M and N?

#define M #define N /* Mystery number 1 */ /* Mystery number 2 */ int arith (int x, int y) { int result = 0; result = x*M + y/N; /* M and N are mystery numbers. */ return result; }

Step by Step Solution

3.39 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

We have found that people have difficulty with this exercise ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Systems A Programmers Perspective Questions!