Getting Started with sim11

A simple introduction to some of the features available in the GUI for sim11.

User Interface Overview

When you run the command sim11, you get a screen that looks something like:

       +---------------------------------------------------+
       |File Config Help                         (MENU BAR)|
       +---------------------------------------------------+
       | Step Trace Run Stop   Viewpoint          (TOOLBAR)|
       +---------------------------------------------------+
       |+----------+ |+----------------------------------+ |
       ||          | ||                                  | |
       || stats    | ||    Trace/Messages                | |
       ||          | ||                                  | |
       |+----------+ |+----------------------------------+ |
       |+----------+ |+----------------------------------+ |
       ||          | ||                                  | |
       || registers| ||  Source code                     | |
       ||          | ||                                  | |
       |+----------+ ||                                  | |
       |+----------+ ||                                  | |
       ||          | ||                                  | |
       || memory   | ||                                  | |
       ||          | ||                                  | |
       |+----------+ |+----------------------------------+ |
       +-------------+-------------------------------------+
      

The File button

The File button in the menu bar is the place to start. Press the button and then press the Samples choice. After a short delay, a window pops up allowing you to select an assembly language file to load into the simulator.

Double click on the file ex1-simple.asm. This loads the source and object code for the example; messages indicating this are displayed in the Trace/Messages window and the source code is displayed in the Source Code window.

Single Stepping

Note that the program counter is initialized to 0x6000. (All the registers are displayed in hexadecimal.) Furthermore, the source code line corresponding to the instruction at this address is highlighted in the Source Code window.

Click the Step button in the Toolbar to single step the next instruction (clra in this case which clears Accumulator A to zero.) Once it has executed, the AccA register value (in the Registers window) is updated to its new value. Furthermore, the Trace window shows the disassembled instruction that has just been executed and the values of all the registers. Similarly, the source code window highlights the next instruction. (Thus the trace window shows the previous instruction and the source window indicates the next instruction.)

Continue single stepping 3 more times until the instruction at address 0x6008 is highlighted. The next exercise explains how to use Breakpoints.

Breakpoints

Single-stepping can get tedious. You can also run at full speed, but in this case it is useful to set Breakpoints to stop full speed simulation.

You set a Breakpoint (or unset one previously set) by clicking in the Brk box on the line where you want the breakpoint.

You can now simulate at full speed by clicking the Run button in the Toolbar. The program stops again quickly. The tracing is disbled during full speed simulation, but the message indicates that 8 instructions that took 31 clock cycles were simulated.

Viewpoints

Although tracing and updating the visual display of register contents is disabled during full speed simulation, you can view the contents of selected memory locations during full speed simulation. This is done by setting viewpoints at the desired memory locations.

The variables of interest are at locations 0x7000 and 0x7001. Click the Viewpoint button to set one up and enter the address you want. (You can set up as many Viewpoints as you want.)

Run the program a few times. It will continue to stop at the breakpoint, but the values in the Viewpoint(s) will change. (The astute reader may note that the program generates the Fibonacci series.)

To demonstrate that viewpoints work even without breakpoints, remove the current breakpoint (by clicking on its box) and click Run. The program will now run without stopping, but the Viewpoints will be updated dynamically (and quickly). (If you have set other breakpoints, delete each one when it is hit and click Run again; eventually all breakpoints will be removed and the simulation will procede at full speed.)

To stop the full speed simulation, click the Stop button.

by Ken Clowes