Assignment 5, due Sept 26

Part of the homework for 22C:60, Fall 2008
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Remember to write your name on what you turn in! Homework must be turned in on paper and in class!

Homework

  1. Background: Consider the following Hawk program fragment.
    LABEL:  LIL	R3,LABEL
    	LEA	R4,LABEL
    	LOAD	R5,LABEL
    

    a) Explain the value in R3. (0.3 points)

    b) Explain the value in R4. (0.3 points)

    c) Explain the value in R5. (0.4 points)

    Note that you cannot give the values in these registers because this program fragment is out of context, but you can explain what the values are. Concise explanations will receive the best credit, long winded explanations will be penalized.

  2. A problem: Translate the following little code fragment to Hawk assembly language: (2 points)
    int x = 0;
    int y = 0;
    dspini();
    while (x < 8) {
    	dspat( x, y );
    	dspch( "+" );
    	y = y + x;
    	x = x + 1;
    }
    

    Note that you are required to submit source code, you need not run your program. If you assemble and run it, you will be able to test your solution, but you will be graded on the program, not its execution. As usual with all grading of programs, readability and clarity of your code will count for half credit.