CSE/EEE 230 Project 5 (updated)

Due April 30th 2011.   11:59 pm

This Project is the third one, of three continued projects to write an emulator for the MIPS machine.

 [The project can be written in C or C++ or Java, see notes at end.]


To the emulator you wrote in project 4, now add the following features:

1.      Instructions:  JAL, JR. // These were actually assigned in Proj 4, so it is already there.

2.      The stack section  (explanation below)

Like Project 3, this project, there will be 2 input files. The input file names are [name].t and [name].d for the text and data sections. Hence to run the program, you provide it with the argument “name” and it reads name.t and name.d. Even though there is a stack segment, we DO NOT need a file to store the stack segment. (Why?)

Stack Section:

Use a separate array to store the data section. Size of this array should be 2048 integers. The stack pointer points to the bottom of the array. That is, the stack segment ends at the stack pointer. This is due to the oddity that the stack grows bottom up. In other words, the initial value of the stack pointer (0x7FFFEFFC) corresponds to index 2047 of the stack array. (Making the stack and the data section in the same array is not recommended. Even the hardware implementations use separate page tables and other considerations for areas that are far apart from each other).

LW and SW should work regardless whether the addresses provided to them are data or stack (or even code) segment. As you are aware, the data segment addresses start at 0x10010000 (256Mbyte) and the code segment addresses start at 0x00400000 (4 Mbyte) and the stack segment addresses start at… you figure out where. (Hint: The stack segment addresses end at 0x7FFFEFFC (2 GByte).


In addition to the FFFFFFFF and FFFFFFF0 instructions, please add the following instructions:

FFFFFFF1 – prints the value of $v0 in hex.
FFFFFFF2 – prints a “ –  (no quotes – space, minus, space)
FFFFFFF3 – prints a “newline”
FFFFFFF4 – prints a “ > “


Do not implement the Heap. You may choose to do that for fun.

Programming Notes:

The “syscall” instruction is not being assigned as syscall is really a complex instruction that calls an interrupt routine and interrupt routine implementations have not been discussed. The interrupt routine is used by the MARS assembler to provide runtime support library calls.

Test using your Fibonacci program.

Submission instruction

Place your emulator files into a folder. Comment your code well and include your name and email in each source file. Also place the binary program files of any programs you have tested the emulator on, into files name test1.t, test1.d test2.t, test2.d and so on. ZIP all files into one file and send it to teaching assistant’s email. Please keep the following file naming rules.

Zip file: LastName_FirstName_ASUID.zip


Only last submission will be graded if multiple submissions are found.

Late submission is rarely accepted, and may carry penalties.


Grading Criteria:

Your emulator works on your test cases: 60%
Your emulator works on other test cases, we create: 40%