This first assignment consists of two parts, and must be turned in on paper at the beginning of class, 26 September 2006.
Part One
You must write a MIPS assembly language program that multiplies two numbers together by using addition inside of a loop. X times Y can be calculated by adding the number X, Y times.
For each different kind of assembly language instruction produced by this program, you must show the bits of the instruction as they appear in the machine language (translate from the hexadecimal code seen in the PCSpim simulator).
In this part of the assignment you need to turn in your assembly source code, an example screen shot of the simulator after a run (so that your answer appears somewhere), and the table showing the different machine language parts of each command created.
Part Two
Write a MIPS assembly language program that prints out the first 10 fibonacci numbers. You must write a procedure in assembly that takes a number as its input and returns the appropriate fibonacci number, calculated recursively. The equivalent C method for fibonacci might be
int fibonacci( int number) { if( number < 2) return( 1); return( fibonacci( number - 2) + fibonacci( number - 1)); }To see a (successful) recursive call in action in assembly, take a look at this cleaned-up version of the code which was written on the board in class on Thursday (21 September).
For this part of the assignment, please turn in a copy of your source code plus the output of a successful run.