Programming and Debugging in LC-2 - UNIX version

Setting Your Path

You need to perform the following steps only if you work in Unix.

After you have telneted to an ECE machine, type the following commands.

How to write your programs

You can write your LC-2 programs in any text editor. Available text editors on UNIX (Linux, Solaris, etc) include emacs, pico, vi, and nedit. Choose one you are comfortable with and start writing. For example, if you want to use pico and name your prog ram myprog then you can start pico like this at the UNIX prompt:
pico myprog

How to Run the LC-2 Simulator

To run the LC-2 simulator type the following at the UNIX prompt.
simulate &
If this does not work try setting your path or typing
/usr/local/packages/lc2/bin/simulate &
After you hit enter, you will see two windows popping up. One is a white window with a bunch of numbers on it. This is the LC-2 simulator window which you need to get familiar with. The other window is a black window. It is the console and important messa ges will be printed on that window. Now let's load the program you converted into the LC-2 simulator.