You are on page 1of 23

MARIE Simulator

Dr. Qi Zhu zhuq@uhv.edu

Outline
Introduction Install & Run MarieSIM Run MarieDP

Fall 2010

Introduction
MarieSim is an environment within which you h h h can write your own programs and watch how they would run on a real "von Neumann von architecture" computer system. By running programs on this simulator, not simulator only will you see your programs in action, but y you will also get a taste of assembler g language programming without learning any particular assembly language beyond the simple instructions that textbook has presented.

Fall 2010

Introduction (Cont.)
MarieSim was written in the Java language so that the system would be portable to any platform for which a Java Virtual Machine (JVM) is available. Students of Java may wish to look at the simulator's source code, and perhaps even supply improvements or enhancements to its simple functions.
Fall 2010

Simulator Features
Support for the MARIE assembly language introduced in Chapter 4. An integrated text editor for program creation g p g and modification Hexadecimal machine language object code An integrated debugger with single step model, break points, register and memory tracing A graphical memory monitor displaying the 4096 addresses A graphical display of MARIE s registers MARIEs
Fall 2010

Simulator Features (Cont.)


Highlighted instructions during program hl h d d execution User-controlled execution speed U t ll d ti d Status messages User-viewable symbol tables An interactive assembler that lets the user correct any errors and reassemble t d bl automatically. Online help
Fall 2010

Install & Run


Software MarieSim-v1.3.01.zip download page http://computerscience.jbpub.com http://computerscience jbpub com /ecoa/2e/student_resources.cfm
Or WebCt -> Download softwares Use winzip.exe to extract and get

MarieSim.jar Double click on the MarieSim.jar icon to invoke the MARIE simulator
Fall 2010

Register

Input/Output

Assembly Code

Memory States

Fall 2010

An Object Example Example 4.1: Using a loop 4 1: to add five numbers

Fall 2010

Invoke the code editor


From the [File] menu on the menu bar, select [Edit] as shown in the illustration.

Fall 2010

Enter the program source p g code.


Using the editor pop up window, type your window MARIE assembly instructions. The MARIE editor supports basic editing functions such as cut and paste. t d t

Fall 2010

Save the program source code.


Select [Save] from the menu bar of the l [ ]f h b f h editor. The simulator automatically saves the file with a .mas extension. mas extension

Fall 2010

Assemble the program source code


Select [Assemble] from the menu bar.
If your program contains no errors, a message displays at the bottom of the editor telling you that the assembly was successful. successful If your file contains errors, the assembly listing will pop up on the screen and the screen, message at the bottom of the editor will be highlighted. g g ted
Fall 2010

Assemble the program source code

successfully
Fall 2010

Load the program


Close the editor window by selecting [File] Cl th dit i d b l ti [Fil ] [Exit] or by clicking on the close icon at the upper right hand corner of the editor panel. right-hand From the main simulator pane select [Load] from the [File] menubar option. The file dialog pops up, showing you all of the MARIE executable files (.mex) files in the current directory. You can navigate through directory your directory structure if needed.

Each time you reassemble a file, ac e easse e e, you must reload it.
Fall 2010

Load the program

Fall 2010

Run the program


Select any of the run mode options from the [Run] menu. This menu allows you to turn step mode off and on, and set a delay between each instruction.

Fall 2010

Run the program

Fall 2010

Observe data path instruction execution


Double li k D bl click on the MarieDP1.jar h icon to invoke the MARIE simulator

Fall 2010

Load an executable Marie file.


Select [Load] f S l t [L d] from the [File] menu on th [Fil ] the menu bar. A file dialog will appear that shows all fil di l ill th t h ll of the MARIE executable files in the currently logged directory (You can directory. navigate the directory structure as needed.) needed ) Note: The data path simulator will load only executable (.mex) files that have ( mex) been assembled in the Marie simulator.
Fall 2010

Run the program


To begin T b i execution, you can select [Run] or [Step]. ti l t [R ] [St ] If you select [Step], a single fetch-decode-execute cycle is processed in the simulator. [Run] executes the program without pausing. (You can stop the program during its execution.) If you find that observing the instruction fetch part of the simulation becomes boring, you can turn "fast fetch mode" on. This feature reduces the delay between machine cycles during instruction fetch only. The machine cycle delay is restored for the rest of the instruction execution.

Fall 2010

Run the program

Fall 2010

More References
QuickGuide.doc MarieGuide.doc

Fall 2010