Homework assignment 7

Submit solutions to Expertiza under the names "linker" (part 1) and "circuits" (part 2). Submissions are due by 11:59pm on Monday, March 16.

Part 1

Submit answers to these exercises to Expertiza in a single text file under the name of "linker".

Here is some C code:

    int array1[10];
    void funct (void) {
        int array2[10];

        array2[3] = array1[3];
    }

(The procedure doesn't do anything very interesting.)

  1. Give as specific a description as possible of the code that the C compiler will generate to load register $t0 with array1[3]. (Actual instructions are more specific than pseudocode.)

  2. Give as specific a description as possible of the code that the C compiler will generate to store register $t0 into array2[3].

  3. For each of the code segments in parts a and b, we want to know the earliest stage in the compilation process at which the final numeric values of the fields in all the relevant instructions are known.

    Are the numeric fields in the instructions that load $t0 with array1[3] first known ...

    Briefly explain.

  4. Are the numeric fields in the instructions that store $t0 into array2[3] first known ...

    Briefly explain.

Part 2

Submit answers to these three exercises to Expertiza in a single text file under the name of "circuits".

Part 3

By 11:59pm on Monday, March 16, provide a peer evaluation of classmate homework 6 submissions designated by Expertiza.

Also complete the midsemester survey in an accompanying activity.