MIPS Tools Reference


This page contains general documentation that applies to all of the MIPS tools. The following list of links points to individual documentation pages for each tool:

Running the Tools

For examples of how to run these tools, see the documentation for the individual tools. These tools are all written in Java and share a lot of code. Each tool has a main method in a class in the package mips. To run a particular tool, the java command must be invoked with the appropriate class name.

Types of Files

MIPS makes a distinction between source files, MIPS modules, and MIPS programs. Source files are text files that contain MIPS assembly language statements and directives, typically created by a human programmer. Source files are assembled into MIPS modules, with one source file resulting in exactly one MIPS module. A collection of MIPS modules is then linked together to form a MIPS program. Module and program files are binary files which cannot be read directly by a human, although the mips.lst utility can show the contents of a module or program in a human-readable way.

File Names

MIPS files are required to use certain file name extensions. Therefore, typing these extensions would be redundant, so the MIPS tools are all designed to use just the base name of the MIPS file in question. The extensions are as follows:

File TypeExtension
Source Code.mips
Module.mo
Program.mx

For example, when telling mips.asm to assemble the file test.mips to produce the MIPS module test.mo, only "test" should be specified on the command line.

Entry Point

When writing main programs (as opposed to subroutines), the entry point is indicated by the exported label main. That is, the first instruction executed will be the one labeled by main. However, a .globl main directive must be used to make main be the starting point for the program. This prevents accidental inclusion of more than one entry point in a multi-module program.