Assignment 4, due Sep 16
Part of
the homework for 22C:60 (CS:2630), Fall 2011
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper at the start of class on the day indicated (usually Friday). Exceptions will be made only by advance arrangement (excepting "acts of God"). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
USE "hawk.h" . = 0 LIS R1,1 ADDI R2,R1,1 LIL R3,3 MOVE R4,R2 ADDSI R4,2 ADD R5,R3,R2
a) If execution begins at location zero and all 6 of the above instructions are executed, what values do these instructions leave in registers? (0.5 points).
a) Show the contents of the memory locations that hold the above code. That is, show what the assembler (plus the loader) put into RAM when the above code is assembled. (1.0 points)
Note: Both of the above problems are typical exam questions from the first midterm. You must learn how to do this by hand, but you can check your answers using the assembler and the Hawk emulator.
MACRO LI =dst, =const IF (const > x) & (const < y) LIS dst,const ELSEIF (const > z) & (const < w) LIL dst,const ELSE LIW dst,const ENDIF ENDMAC
A Question: Give the appropriate values for x, y, z and w. (0.5 points)