Testing and Debugging of Programs
Shown below are the steps
needed in order to test and run programs using the THRSim11 simulator available
in MWAH 102, and the 68HC11 EVB evaluation card available in MWAH 355:
Using the Simulator to Prepare a Program for Assembly on the EVB board:
a) Use the simulator to edit your program, using the
instructions, pseudo instructions and comments needed to implement your program. Verify proper function with the simulator.
b) Define your data area to start at address C000 ( ORG
$C000)
c) Define your user program area starting at address C100
(ORG $C100)
d) The last “instruction” to be executed by your program
should be SWI (this is actually a Directive for the assembler)
e) Store your file as text file with a format of NAME.asm
and port it to your network account with the procedure below.
f) Using any ftp program connect to “ub.d.umn.edu”, and
transfer the file “NAME.asm” to your account.
Turn
on the terminal power supply, wait for the screen to light up and follow the
next sequence of commands, text in bold
is given by the terminal, text is italics
is given by the user.
Rdy-G,L,M,O,R
o
login: id ( your account name. See FIRST LOGIN at bottom)
password: *******
% ftp ub.d.umn.edu
name: userid
password: ******
ftp> get name.asm (transfer
the file from UB to the local unix server)
ftp> quit
% asm11 name.asm (assemble the program, creating a machine language file,
srecord)
% ^Z
Rdy-G,L,M,O,R
L
Load
% cat srecord (the catalog command dumps
the srecord file into the HC11)
Done
Rdy-G,L,M,O,R
At
this point you can use the M command
to initialize memory locations (if necessary), then run your program using the G command, the starting address to
execute the program should be C100, when your program finishes execution you
can again use the M command or R command to check the results
Summary
of Monitor Commands:
G –
execute program currently in HC11 memory
L –
load a new program into memory
M –
view or change data in memory locations
R –
view data located in registers
O –
go online to the unix file system
FIRST LOGIN:
Turn on the power switch for the lab
station (located on the black box with black power cord). You’ll see:
Rdy-G,L,M,O,R
Type the following:
o
Typing the letter o tells the monitor program that
you want to be ONLINE, or in other words, you want to login to the unix file
server, a SPARCStation in the Lab.
Next, after a delay of a few long seconds, you’ll
see:
login:
You should type in EITHER your X.500 username or the initial of your first name and your last name, up to 8 characters total (e.g. snorr) and hit Enter (carriage return). Only 1 will work, but I’m not sure which will do so.
At this point you should be prompted to establish a password for your account on the local server. Follow the instructions as directed.
Once you’ve properly logged in, you should see a
percent sign, %, prompt. Send me an
email by typing the unix command, mail:
% mail snorr <enter>
This will invoke the email editor. Write a brief message and finish the message
by typing a single period . on a new line and press <enter>
You can “break” out of unix by holding down the
<ctrl> key and the z key at the same time:
% <ctrl> Z (doing this, brings you back to….)
Rdy-G,L,M,O,R (….this)
IMPORTANT:
doing a <ctrl> Z will not logout your unix connection. You can return to it with the O
command. ALWAYS logout of unix at the
end of a session and turn off the power supply.