|We assume that by now you are familiar with the CSE Instructional Labs and have an account on the Linux servers: ceylon, fiji, sumatra, and tahiti. The instructions below assume you are on one of these machines.|
|Create a directory for the PL/0 compiler and copy the sources there
from /cse/courses/cse401/00sp/pl0 .
(The sample commands below all assume you are in your compiler directory.)
cp /cse/courses/cse401/00sp/pl0/* .
|You need to make sure file permissions are correct: accessible by you,
but not by others.
chmod -R u+rwX,go= .
|Check that /usr/bin/g++ and /usr/bin/make are in your PATH, for example, by running which g++ . If it is not the case, add /usr/bin to your PATH.|
|To compile the PL/0 compiler type, run make in your compiler directory. (You may get a few warnings from the C++ compiler; you can ignore these.) This should produce an executable called plzero.|
|Now you must either create a PL/0 program, or use one of the
provided samples fib.0 or squares.0 , which you
copied along with the compiler sources.
To compile a PL/0 program, run the compiler executable and specify the
file with program as an argument. For example, to compile fib.0 ,
./plzero fib.0This will create an assembly language program named fib.s .
|The assembly language program created in the previous step will now
be the input to the mips simulator called "SPIM".
A prompt-driven gdb-style version of SPIM can be run as
/cse/courses/cse401/spim/linux/bin/spimOnce in SPIM, load and run your program (say, fib.s) with the following commands (SPIM's prompt is in itallic below):
(spim) load "fib.s" (spim) runA more user-frieldly X-based version of SPIM can by run as
/cse/courses/cse401/spim/linux/bin/xspimClick on the "load" button and type in your file's name, then click the "run" button.
|For more details on running spim or xspim,
man pages are available by running
man -M /cse/courses/cse401/spim/man spim man -M /cse/courses/cse401/spim/man xspimThis file has everything you want to know about spim. Do look at it once. It's a great help!
When you are required to submit compiler code, it must run on the Linux servers listed above. If you really need to work under NT, you are on your own, but check out instructions from Fall'99 class here.