PMIS 0.4 Manual

Table of contents

About PMISControl Panel
Advantages over SPIM   Memory addressing mode
Disadvantages   Base of displayed output
Writing a program   Max. iterations
Running a program   Instruction representation
Stepping through a programPMIS hints and tips
ResettingUser defined programs
   Reset mem & regsDemonstration programs
   Reset regsPMIS instruction set
Things to do
Report bugs/feedback

About PMIS

Welcome to PMIS - an interpreted simulator of a simulator - a "spimulator", if you like! It takes a few assembly language instructions from the MIPS instruction set, and uses Javascript to process programs you can write yourself within the PMIS integrated development environment.

It has not been tested on any browsers less than Netscape 6.2 and Internet Explorer 6.

[back to top]

Advantages over SPIM

The user has/can:
[back to top]

Disadvantages

[back to top]

Writing a program

Either:
Type PMIS instructions into the text box on the left of "PMIS 0.4".

Or:
Click on the PMIS instruction buttons to insert the correct syntax of the desired expression, and then overwrite the question marks. (The instructions always insert at the end, not the cursor position).

Comments

To insert a comment, surround it with "#", i.e.:
addi $t0, $r0, 1 #initialise to 1#
addi $t1, $zero, 2 #initialise to 2#
beq $t2, $t4, skip1 #make decision#

Clearing the text box

If you wish to delete the current text, click "Clear".

Assembly language text box memories

There are also two memories available to store the contents of the assembly language text box. The "Store ?" buttons store the program and clear the box; the "Recall ?" buttons retrieve the contents from memory. (PS, the memory is volatile!)

Demonstration program

A demonstration program can be recalled by clicking on "Demo". In addition to this, this manual contains some demonstration programs which can be run by cutting and pasting into PMIS' text box.

Running a program

Push the button marked, "Start Spimulating". If the program runs correctly, "Start Spimulating" will change to "Run again?" (using current register values). This is the only feedback the user will receive in response to the program completing all instructions.

If the program is not successful, an error box may advise you of any syntax errors, and where to fix them in your code.

If any errors cannot be identified by the syntax checker, or the program cannot terminate correctly (writing data throughout instruction memory, for example), the "Run again" message should not appear.

[back to top]

Stepping through a program

Push the button marked "Step through prog" until the end of the program is reached. The face of the button will change to show the hexadecimal value in memory of the last instruction executed. If you wish to quit a program before stepping through completely, please reset the registers before starting another program.

[back to top]

Resetting

Reset mem & regs

Pushing this will clear the registers, resetting the stack pointer to the end of memory, and clear the memory contents including the program. It used to set the control panel values back to default, and the text box to blank, but this proved to be a pain.

Reset regs only

This just clears the registers, but also resets the stack pointer to the end of memory.

[back to top]

Control Panel

Memory addressing mode

This enables the user to choose between the program running in little-endian or big-endian mode. If you run the demonstration program "Little-endian versus big-endian" once in each mode, the difference will become instantly clear.

Base of displayed output

All output from a program is displayed in the 32 registers in hexadecimal. However, by selecting "Binary" or "Decimal", a pop-up box will show all 32 registers in that base after each step (in step mode) or at the successful end of a program run.

Max. iterations

There is no trap-handler in PMIS. In the event of any deliberate or inadvertent infinite loops, after this number of iterations (the default is 100,000), the program will simply abort with a warning. Increase the number in this box if your program needs it.

Both Netscape and Internet Explorer are smart enough to know that a big loop is happening, and may advise you of this asking you if you wish to terminate the script before the program has finished running. If this happens, and your program is valid, hit "Yes" to continue.

[back to top]

Instruction representation

The 400 bytes of "memory" in PMIS also holds the program instructions. For convenience, the default representation is in assembly language, complete with the labels. These can also be viewed in hex (The word "instruction" is automatically appended so instructions can be differentiated from the rest of the contents of the memory). Binary output can also be selected, which is useful when writing or testing in machine language.

(Yes, it IS inconsistent displaying instructions in one format and data memory in another...)

Just remember that PMIS' memory addresses start at 0, unlike SPIM. This means that you will not be able to compare PMIS output with SPIM output for instructions which utilise labels such as "j", or "jal" without adding in the difference manually.

SPIM does NOT calculate PC-relative addresses correctly - it works them out according to the offset from the CURRENT instruction, not PC+4. (PMIS uses PC+4, in case that wasn't obvious!) [back to top]

PMIS hints and tips

[back to top]

User defined programs

In order to save any programs you have written in the PMIS IDE, you'll need to cut and paste from the text box into a text file, and save that on your PC for future use.

[back to top]

Demonstration programs

Click for new window

[back to top]

PMIS instruction set

Click for new window

[back to top]

Things to do

[back to top]

Valid HTML 4.01
Last updated on 27 November, 2003 by Paul Morris