LC-3 Quick Start Guide (for LINUX!!)

First off...

The LC-3 simulator is what you as a CS310h student will be using to complete your programming assignments. Using it is pretty straightforward, but, there are some things that you need to take care of first.

The very first thing to check for is that you are logged into a Linux machine. Also, make sure that you are in XWindows. If you saw any Microsoft or Sun logos on the way to reading this webpage, you are not logged into the right place.

In case you are sitting in front of the Linux machine, and don't know how to get started, here are a few simple steps.

  1. Type your user name at the login: prompt.
  2. Type your password at the password: prompt.
  3. Once you are logged in, type "xstart".
You should now be logged into a Linux machine and running XWindows. Somewhere on your screen should be a shell window that contains a command prompt (it looks like a DOS window for the Microsoft people out there). This is where you need to be for the rest of this guide. If you did not recognize any of the things on that list, please go to the department's Computing Facilities website and click on the Frequently Asked Questions (FAQs) link. As the title suggests, the questions you have in your head have been asked before, and probably quite frequently. And yes, the questions do come with answers.

So, you really are running Linux.

Not only have you now maybe been introduced to a better operating system, you are ready to set up the environment for using the LC-3 simulator.

We will be using Anthony Liguori's version of the LC-3 simulator. There are two commands that you will invoke from the command prompt to do your work.

For assembling the source code into a binary object file, you will invoke the LC-3 simulator by running the script assemble. You do this by typing the following at the command prompt:
/p/bin/lc3asm source-asm-file
For example:
/p/bin/lc3asm test.asm

This will produce the file test.obj, which is the binary object file. For your reference, it also produces the file test.hex, containing the translation of your source file into hexadecimal format.

To simulate the program you have just assembled, type the following at the command prompt:
/p/bin/lc3db --ddd

This will open up a graphical interface to the simulator, where you can load your object file. A command line interface is also available (leave out the --ddd option from the above command):

Happy Simulating!

More detailed instructions for running the simulator will be given in discussion section. A user manual written by Anthony Liguori is available here. Enjoy...

Last modified: 03/12/2009 by Don Fussell