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.
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):
/p/bin/lc3db
More detailed instructions for running the simulator will be given in discussion section. A user manual written by Anthony Liguori is available here. Enjoy...