Using DLXsim
¿½§»³¹ (3/18/97)
1. Introduction
DLXsim is a simulator for the DLX instruction set.
It is an interactive program, which loads the DLX assembly code and
simulates the exeuction of a DLX computer.
It allows single-stepping or continuous execution through the input DLX
code.
It also allows users to set breakpoints, view and modify memory and
registers, and print statistics information of the run-time.
2. Environment
- Machines: cs20.cs.nthu.edu.tw
- Add /tmp_mnt/user/prof/king/tools/dlx/bin into your search path.
Programs under that directory are:
- dlxsim: simulator and debugger for the DLX instruction set
- dlxcc: compiler for generating DLX assembly
code from C source code
- Reference directories:
/tmp_mnt/user/prof/king/tools/dlx/bin,
/tmp_mnt/user/prof/king/tools/dlx/doc, and
/tmp_mnt/user/prof/king/tools/dlx/test.
3. Example Usage
Under /tmp_mnt/user/prof/king/tools/dlx/test, there are two files
containing samples DLX assembly code, f1.s and fdata.s,
where f1.s is the code segment and fdata.s is the data segment.
- Type dlxsim after the shell prompt
- (dlxsim) load fdata.s
- (dlxsim) load f1.s
- (dlxsim) get 256 9i
- (dlxsim) stats stalls pending branch
- (dlxsim) step
- (dlxsim) step
- (dlxsim) go
- (dlxsim) stats all
- (dlxsim) quit
As anther example, copy /tmp_mnt/user/prof/king/tools/dlx/test/hanoi.c
to your local directory.
- Compile the program with
dlxcc -DNO_TIME hanoi.c
which produces hanoi.s.
- Type dlxsim after the shell prompt
- (dlxsim) load hanoi.s
- (dlxsim) go _main
- (dlxsim) stats
- (dlxsim) quit