MARS - Mips Assembly and Runtime Simulator
Release 4.5
August 2014
Configuration Settings
Releases 3.0 and later include a Settings menu. The Editor and Exception Handler items launch a dialog but the rest are each
controlled by a checkbox for selecting or deselecting it (checked means true, unchecked means false). Settings and their default
values are:
- Display the Labels window in the Execute tab. Default value is false. If selected, the Labels window,
which shows the name and associated address for each label defined in the program, will be
displayed to the right of the Text Segment.
- Provide program arguments to the MIPS program. Default value is false. New in Release 3.5.
If selected, a text field will appear at the top of the Text Segment Display. Any argument values in this
text field at the time of program execution will be stored in MIPS memory prior to execution. The argument
count (argc) will be placed in register $a0, and the address of an array of null-terminated strings containing
the arguments (argv) will be placed in register $a1. These values are also available on the runtime stack ($sp).
- Popup Dialog for input syscalls (5,6,7,8,12). New in Release 4.0. Default value is false. If selected, runtime console
input will be entered using popup dialogs (this was the only option prior to Release 4.0). Otherwise, input is entered
directly into the Run I/O tab at the bottom of the screen.
- Display memory addresses in hexadecimal. Default value is true. If deselected, addresses will be displayed in decimal.
This setting can also be toggled in a checkbox on the lower border of the Data Segment Window.
- Display memory and register contents in hexadecimal. Default value is true. If deselected, vlaues will be displayed in decimal.
This setting can also be toggled in a checkbox on the lower border of the Data Segment Window.
- Assemble a file automatically as soon as it is opened, and initialize the File Open dialog with the most-recently opened file.
Default value is false. This is convenient if you use an external editor for composing your programs.
- Assemble applies to all files in directory. Default value is false.
If selected, the file currently open in the
editor will become the "main" program in a multi-file assemble-and-link operation involving all
assembly files (*.asm; *.s) in its directory. If successful, execution will begin with the currently open file.
- Assembler warnings are considered errors. Default value is false. New in Release 3.5.
If selected, the assemble operation will fail if any warnings are produced. At this time, all assembler warnings
relate to unrecognized or ignored directives. MARS may be able to assemble code produced by compilers for other MIPS
assemblers if this setting is deselected.
- Initialize Program Counter to global 'main' if defined. Default value is false. New in Release 3.8.
If selected, the Program Counter will be initialized to the address of the text segment statement with the global label 'main' if it
exists. If it does not exist or if the setting is not selected, the Program Counter will be initialized to the default text segment
starting address.
- Permit programs to use extended (pseudo) instructions and formats. Default value is true. This includes all memory addressing
modes other than the MIPS native mode (16 bit constant offset added to register content).
- Assemble and execute programs using delayed branching. Default value is false. MIPS processors use delayed branches
as part of the pipelined design, but it can be confusing to programmers. With delayed branching, the instruction
following a branch or jump instruction will always be executed even if the branch condition is true! Assemblers
and, failing that, programmers, often deal with this by following branches and jumps with a "nop" instruction. The MARS
assembler does not insert a nop. When delayed branching was introduced in Release 3.3, the machine code generated
for a branch instruction depended on this setting since
its target value is relative to the Program Counter (PC-relative addressing). Although technically correct, this led to
confusion in the MARS community because the generated code did not match textbook examples. Starting with Release 3.4, the relative branching
offset is always calculated as if delayed branching is enabled even when it is not. The runtime simulation adjusts accordingly.
- Self-modifying code. Default value is false. New in Release 4.4.
If selected, a running MIPS program can write to a user text segment address and can branch/jump to a user data segment address.
These capabilities permit a program to dynamically generate and/or modify its binary code. Also permits interactive modification of
text segment contents through either the Data Segment or Text Segment windows.
- The Editor dialog. Use it to view and modify editor font settings. New with Release 3.3.
- The Highlighting dialog. Use it to modify color and font settings for the highlighting of table items in the
Text Segment window, Data Segment window, Registers window, Coprocessor0 window and Coprocessor1 window.
Highlighting occurs during timed, stepped, and backstepped simulation. Color and font for normal (non-highlighted)
display can also be set separately for even-numbered and odd-numbered display rows but not individually by windows.
New with Release 3.6.
- The Exception Handler dialog. It has the setting: Include this
exception handler in all assemble operations. Default value is false. If selected, a button to browse to the desired
file is enabled. New with Release 3.2
- The Memory Configuration dialog. Use it to select from among available MIPS address space configurations.
The default configuration is derived from SPIM; it was only one available from MARS 1.0 through MARS 3.6.
New with Release 3.7.
Beginning with Release 3.2, settings are retained from one interactive session to the next. Settings are stored in a system-dependent
way as specified by java.util.prefs.Preferences. Windows systems use the Registry.
These settings are independent of command options given when using MARS from a command line;
neither affects the other. We anticipate future releases will include additional settings and preferences.