MC48 Homework 2 (Fall 1998)
Due: September 23, 1998
-
Do exercise 3.1 from page 197. Also, write an alternate
version of the program that only uses one branch or jump instruction
each time through the loop, rather than both a branch and a jump each
time. For full credit, your version should produce the same result as
the given one for all integer values of n, rather than only
when n is positive.
-
Do exercise 3.14 from page 200.
-
Do exercise 3.17 from page 201.
-
Write (in MIPS assembly language) a procedure named
whence
, such that after calling the procedure with the
instruction
jal whence
the procedure will return (to the next instruction) with the
$v0
register containing the address in memory where that
jal whence
instruction occurs.
Instructor: Max Hailperin