Lab 8: Function Conventions

Goals:

By the conclusion of this lab, you will have:

  1. Looked directly at the text segment, the data segment, and the registers within PCSpim.

  2. Reinforced your understanding of MIPS conventions and parameter passing mechanisms..

Phase One:  Explore the Segments

  1. Begin by loading the program lab7.s into PCSpim.  This is a solution to last week's lab with all of the I/O removed.  Within PCSpim, the code is displayed within the text segment window.  Open up the data segment and the register windows as well and arrange your windows so that you may look at each window separately.


  2. Using the F10 key, single step through the program.  As you go through it, watch the various windows and answer the questions on the attached worksheet.

Phase Two:  Putting the Knowledge to Work

  1. Examine the C++ program Lab8.cpp.  Implement it in MIPS and test your implementation in PCSpim.  You must obey all standard MIPS function calling conventions.  You must even obey the conventions for the main() function.  (Thus, you should not make the exit syscall.)

    Note that the program has no output.  You will need to test its results by examining the various windows as in Steps 1 and 2.

    Print a copy of your well-documented program.


To Hand In

  1. You are to hand in the worksheet from Step 2 and the code listing generated in Step 3 - along with a cover page.

 

Help Policy

        Help Policy in Effect for This Assignment: Group Project With Limited Collaboration

       In particular, you may discuss the assignment and concepts related to the assignment with the following persons, in addition to an instructor in this course: any Computer Science instructor and any student enrolled in CS 231.

       You may use the following materials produced by other students: materials produced by member of your own group.