University of Florida EEL 4744 Dr. Gugel
Department of Electrical and Co mputer Engineering Fall 2008
Page 1/3
9/10/08 - 3:57 PM
Lab #3: Assembly Programming & Elementary Wiring
Purpose
This lab is an exercise in elementary assembly
programming and basic wiring. It requires
students to write short assembly code routines
for statistical calculations on a sample population
and to wire in an LED display and switches to
the HC6812. If you do not have your 68HC12
development board completed and programmed
do so at an earlier lab.
Part I. Program Description
We would like to compute the average grade in
an array of student grade. See below for
details:
1. Assume that your TA will download into your
emulator memory a vector of student test grades.
The starting address for the vector will be
denoted as score_addr and an equate statement
should be used at the top of your program to set
this variable easily to a new address supplied by
your TA.
2. The length or number of elements in the
vector will be stored as a single byte at address
score_vector_len which also will be given to
you in lab.
3. The test scores or elements of the vector will
be unsigned bytes that range from 0 to 100.
4. We would like you to compute the average
score for the array of scores. You may assume
that the sum of all the scores in the score array
will always be less than 16 bits unsigned.
You final eight bit unsigned answer should be
written to an address specified by
score_aver_addr. Use an equate statement to
set this address at the top of your program.
5. As mentioned earlier, your TA will give you
all required input/output addresses in lab. Thus
you should use assembler equate statements for
all constants in your program. You should also
use equate statements to define origins for the
program and data sections. This will enable your
code to be easily moved (re-located) in memory.
6. Create a dummy score vector and length
and test your program at home. Don’t try to
write the code in lab… you won’t have time!
Your TA will also be asking you questions on
how your program works to see if you are the
original author.
Part I. Pre-Lab Work
1. Create a program flow chart for your program.
2. Code each block in your flow chart in 68HC12
assembly.
3. Assemble and simulate your code outside of
lab to verify proper function.
3. Bring the flow chart and program code
(assembly and list files) to the lab via a memory
stick and also as a hard copy.
Part I. In-Lab
1. Your TA will not allow you in unless you
have the pre-lab materials specified above.
2. A vector containing test scores will be given
to you as well as the vector length. Re-assemble
and test your code with this new information.
3. Verify your computed results with your TA.
4. Answer any questions they have regarding
your code & program operation.
Part II. Adding a 4 Bit LED Display in Lab
We would like to connect 4 LEDs in a DIP type
package to Port T of the 6812. This will enable
us to write out binary values for visual
information feedback during program execution.
While this sounds quite elementary, it will turn
out to be an extremely beneficial debug tool
during run-time.
1. Connect Port T (T3:0) using wire-wrap wires
to four series resistors (where the resistance
should be in the range of ~220-680 ohms). It is
suggested that you mount the resistors (DIP
RPACK) in a wire-wrap socket such that the pins
face down in your development board.