Homework III

Tom Kelliher, CS 240

Due Feb. 25, 2004

  1. 3.22. You are not required to use a frame stack. Turn in hardcopy.

  2. 3.26. Produce a complete SPIM program, utilizing a frame stack. Your program should use three functions: main, getnum, and fib. The program should allow the user to compute as many Fibonacci numbers as the he or she wants. Hence, main, using getnum, should prompt the user for an input value, compute the value using fib, print the value, and then prompt the user for the next input. Main should exit once the user enters a -1.

    First, write a HLL program or pseudocode to solve this problem. Generate frame maps for your SPIM functions and manually compile your HLL to produce your SPIM. Your SPIM code must be carefully formatted and documented. See the fact.spim program for an example. For this problem turn in hardcopy of the following:

    1. Your HLL code.

    2. Your frame map diagrams.

    3. Your SPIM code (and e-mail a copy to kelliher AT DOMAIN goucher.edu).

What you turn in must be easy for me to read and understand. Not following these directions will result in substantial penalties.



Thomas P. Kelliher
Wed Feb 18 08:33:18 EST 2004
Tom Kelliher