LC-3 Simulator::Documentation
[Project] [Lists] [Tracker] [CVS]

About

This project started in BYU'sECEn course on Computer Systems which uses an LC-2 Simulator and Assembler. One of the assignments was to write a command-line simulator in C. Seeing the advantages of a portable, C++ simulator, Will decided to turn his assignment into one and enlisted his brother to help.

Before lc2sim was available to be used in the field, work was abandoned as Ed, Will's brother, left, Will's schedule got busy, and the class changed to the updated LC-3. When Ed returned, he became a TA for the class and updated it to the LC-3 ISA. For historical purposes, the project name is being kept the same, but all references in the webpage have been updated

Then change came in the air once more. The stdio and ncurses versions were made, so work was to commence on a GTK version. After examining our campus EE and CS labs, that was found to be difficult with one of the labs still working off of GTK 1.X and the other a bit more modern. So after some weighing of the different issue, much to Ed's dismay, he found it best to move the project over to Java.

Usage

Starting

To start the basic program, you can type in:

java -cp lc3sim.jar edu.byu.cs.lc3.gui.MainWindow

For stio you have the choice to run:

java -cp lc3sim.jar edu.byu.cs.lc3.ui.Console

For either you may specify the file at the command line or once loaded:

java -cp lc3sim.jar edu.byu.cs.lc3.gui.MainWindow filename.type

"filename" can be of type "mco" or "bin." A bin file is binary file containing machine code, while an MCO file is the machine code in ASCII format with an instruction per line.

To find out what command line options are available to you, type:

$java -cp lc3sim.jar edu.byu.cs.lc3.gui.MainWindow --help
$java -cp lc3sim.jar edu.byu.cs.lc3.ui.Console --help

Running

Once running, you can open up a file, run it, setup break points, modify registers and memory to tweak the running of your program, etc

FAQ

Question

How come this is so much slower then BYU's Java version?

Answer

Though we have worked hard to keep this program fast, it is still not as fast as the Java version. There are several possible solutions.

1) Run the Console Window in Full Screen mode. Our program is a lot more advanced then the java one and that comes at the price of speed. These are things like the memory location labels (PC, Register Pointers) in Memory Window and live updating in the Register and Memory Window (its been so long since used the Java version, I do not think it has this but it might)

2) If you are running the program over a network, maybe switch to running locally on your computer. I've not run over a network but I think it will draw everything, unlike a remote java program which can get "laggy" and draw only the latest

3) Run the command prompt version and debug from the Java internface