University of Florid a EEL 4744
Department of Electrical and Computer Engineering
Page 1/3
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 samp le population
and to wire in an LED display and sw itches 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 convert an array of student
grades to ASCII letter grades. 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 create a new vector of
ASCII letter grades that correspond to the vector
of test scores. For example if the firs t element in
the scores vector is from 90-100 then store the
ASCII equivalent of ‘A’ in memory. Here is the
breakdown for the grade computation :
100-90 score => store ASCII ‘A’
89 - 80 score => store ASCII ‘B’
79 - 70 score => store ASCII ‘C’
69 - 60 score => store ASCII ‘D’
59 - 0 score => store ASCII ‘F’
Thus if the second score in the vector is 73, you
would store a ‘C’ in the second memory location
of the new vector and repeat for all scores as
required by score_vector_len. The starting
address for this new vector will be called
grade_addr and will again be given to you in lab.
You should create an equate for 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
these constants in your program. You should also
use equate statemen ts to define origins for the
program and data s ections. 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 qu estions on
how your progra m 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 s imulate your code outside of
lab to verify proper function.
3. Bring the flow chart and program code
(assembly and list files) to the lab on diskette
and also on hard copy.
Part I. In-Lab
1. Your TA will no t allow you in unless you
have the pre-lab m aterials specified above.
2. A vector contain ing 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 r egarding
your code & program operation.
Part II. Adding a 4 Bit LED Disp lay 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 bin ary values for visu al
information feedback during program execution.