Fall 2014 CSCI 255 Homework 8

This assignment is due in class on 22 October or may be uploaded to Homework 8 on moodle by 2:00 PM on 22 October.

Be MIPS32

Here is a MIPS32 assembly language program.

ACA40000
20020001
1C800003
00000000
ACA00000
2042FFFF
03E00008
00000000

This code was written to implement a function written in C. Here is a prototype for the function. A C prototype is similar to a Java interface, except that the prototype is for only one function and the interface is for all public methods of one class.

  int silliness(int, int *) ;

Problem 1

Translate this program into MIPS32 assembly code using the class MIPS32 instruction sheet as your reference.

Problem 2

Describe what the function does when it is called with the following two sets of argument.

Your description should specificy all the registers and memory locations modified while executing the code.

The last two MIPS32 instructions return from the function. You do not have to mention them in your answer.

Problem 3

Write a C function that corresponds to these MIPS32 instructions. Remember: The last two MIPS32 instrutions return from the function.