CS341, Computer Architecture Lab, Lab 02

Goals

  1. Learn xspim system calls

  2. Learn global data declaration in MIPS assembly language

  3. Understand arrays in the MIPS data segment

  4. Writing a function call

Instructions

  1. These exercises are to be done individually.

  2. While you are encouraged to discuss with your colleagues, do not cross the fine line between discussion to understand versus discussion as a short-cut to complete your lab without really understanding.

  3. Create a directory called <rollno>-<labno>. Store all relevant files to this lab in that directory.

    1. In the exercises, you will be asked various questions. Note down the answers to these in a file called “<rollno>-<labno>.txt”.

    2. In some parts of the exercises, you will have to show a demo to a TA; these are marked as such. The evaluation for each lab will be in the subsequent lab, or during a time-slot agreed upon with the TAs. For this evaluation, you need to upload your code as well.

    3. While submitting (on moodle), you have to create a tar.gz or zip of the entire <rollno>-<labno> directory in which all your relevant files reside.

  4. Before leaving the lab, ensure the following:

    1. You have signed the attendance sheet

    2. You have uploaded your submission

  5. Things to ensure during TA evaluation of a particular lab submission:

    1. The TA has looked at your text file with the answers to various questions

    2. The TA has given you marks out of 10, and has entered it in the marks sheet, with his/her signature

    3. You have counter-signed the above-mentioned marks

  6. You have to use the MIPS conventions, unless mentioned otherwise.

Learning xspim system calls for input/output

Global data declarations, arrays

Using arrays, writing functions