Lab 02: Exploring Data Addressing Modes

This is a very simple exercise whose purpose is to get you acquitted with the common data addressing modes on the SPIM Assembler. For a good view of SPIM commands and assembler directives, see the SPIM Overview presentation

General Instructions

Create a directory for save the results of these exercises on the folder "/usr/local/SysProg/Lab02/students/" using your registration number as directory name. Save the files "lab02a.asm" and "lab02b.asm" on your directory, you will use them to make the experiments. While your are doing it, note your observations in a file called "report.txt". Remember to write a header on all files putting your complete name and registration number. If you are doing the experiments with a partner, write he's information in this header too.

Exercise

The main task in this exercise is to find out, how the MIPS Virtual Machine implements the pseudo-instructions when you use some of the data addressing modes.

First Program

This program prints the elements of the array on the screen. The functions to print data on screen is already implemented on the file "lab01a.asm". You must use this file as basis and write a program that access data on the memory and print it. Use the SPIM directives to declare your data structures

Don't forget to experiment all data addressing modes that apply, and simulate the program on SPIM to see how these modes are really implemented on the bare machine.

Write a report about your observations, highlighting how the data addressing modes are implemented on a bare machine.

Second Program

Now you must use the file "lab02b.asm" to create a program that sums the contents of two arrays and store the result in a third array. This program should print this third array on the screen.

Select the most appropriated data addressing mode. Justify your selection on the report.

Supplied Files