Repeat Exercise 8.6.4, but assuming only two registers are available. Exercise 8.6.4 Convert your three-address code from Exercise 8.6.1 into machine code, using the simple code-generation algorithm...


Repeat Exercise 8.6.4, but assuming only two registers are available.


Exercise 8.6.4


Convert your three-address code from Exercise 8.6.1 into machine code, using the simple code-generation algorithm of this section, assuming three registers are available. Show the register and address descriptors after each step.


Exercise 8.6.1


For each of the following C assignment statements

a) x = a + b*c;


b) x = a/(b+c) - d*(e+f);


c) x = a[i] + 1;


d) a [ i ] = b [ c [i]] ;

e) a[i][j ] = b[i][k ] + c[k][j];


f) *p++ = *q++;


generate three-address code, assuming that all array elements are integers taking four bytes each. In parts (d) and (e), assume that a, b, and c are constants giving the location of the first (Oth) elements of the arrays with those names, as in all previous examples of array accesses in this chapter.



May 22, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here