| EE113L DSP Lab. Fall 1995 | Experiment A - The Software Development Environment | TA: Kei-Yong Khoo Prof: Abeer Alwan |
|---|
C:\DSP\
113L\
COMMON\ - files prepared by TA
EXP_A\ - files for experiment A
EXP_B\ - files for experiment B
....
PROJECT\ - files for final project
BIN\
ADS\
The subdirectory COMMON is used to stored files
prepared for the class. You should put all your files for each
experiment in a separate subdirectory (EXP_A,
EXP_B,... etc.), which will be referred to as the
working directories. You must not leave any files outside
the working directories since they may be deleted without warning.
cd DSP\113L\EXP_A
and copy the file "sort.asm" from
the COMMON subdirectory
to the EXP_A subdirectory:
copy ..\COMMON\SORT.ASM
Assemble the file by:
asm56000 -L -B sort
The -L option instructs the assembler to produce the listing file
"sort.lst" which contains information helpful for debugging a
program with errors. The -B option instructs the assembler to create
the object file "sort.cln." Once your program has assembled
correctly, you will have to link it by:
dsplnk -B sort
You will notice that the linker has created the executable file
"sort.cld." Once you have this, you will no longer need
"sort.cln." If your program ends up running correctly (in this
case, it will), you will also have no need for "sort.lst." You
may delete these two files by:
del *.cln
del *.lst
sim56000
Once the simulator is running, you may load your new program by typing
load sort
All of the available commands for the simulator are listed at the bottom of the screen (you may scroll
through the list by hitting the space bar). The simulator has an excellent online help facility which
explains how each command is used. For instance, if you type
help display
you will see a list of
explanations telling you how to use the "display" command.
display on x:$10..$17
to tell the simulator to include the X-memory locations $0010 through $0017 in the display. Next,
type
display
to enable the simulator display of the DSP56002's registers and the X-memory locations. Run the
sort program by entering
go
The program ends with an infinite self-loop to "trap" the program's execution. Stop the simulator by
typing
ctrl-C (i.e., hold down the "Control" key and type "c").
Verify that the values in X-memory have indeed been sorted in ascending order.
load sort
Turn on the display again by typing
display
You may step through the program line by line with the command
step
Hit RETURN to continue stepping along. Try to verify the
execution of the program line by line (look at the program
counter, the current and previous instructions, the various
registers, and the X- memory locations as you step through).
Notice that the register(s) most recently updated by an
instruction will be highlighted. This helps you to see what the
previous instruction did. (Unfortunately, this is not true of
the memory locations displayed, so keep a close eye on those as
you step through).
There may be times where we only want to step through a certain
part of a program, skipping all of that which comes before that
part. We may do this by setting a "break point." Use the
stepping process to find the program memory address of the first
DO instruction (say the address is $xxxx). Set a break point at
that address by entering
break pc>=$xxxx
This will cause the simulator to halt when the program counter
register is greater than or equal to $xxxx. Reload the sort
program, enable the display, and type "go." You will notice
that the simulator stops when the program counter is at $xxxx.
From there, you may follow the procedure outlined above to step
through the program from that point.
Use the help command in conjunction with the following commands:
change, list, trace, radix and reset. This will give you some
idea of what these commands do and how they are used.