
ECE 331 Spring 2009 Homework 7
Due Friday Mar 20 at the beginning of class.
From HW6
HW6, Problem 6: If you did not turn this in with HW6 or have a new/updated solution, include it
here, clearly indicated for the grade, and it will be graded as part of HW6.
Homework 7
1. a) Briefly describe the assembly process that is illustrated by the programming flow chart
presented in lecture.
b) If you were to plan your programming algorithm using pseudocode, where would that
occur on the programming flow chart?
2. a) Describe the function of an assembler.
b) Specify and describe the output files generated by a 68HC12 assembler.
3. Describe what the following instruction does:
DBNE B, AGAIN
4. Types of memory
a) What does it mean if memory is non-volatile?
b) What is the key difference between RAM and ROM?
c) What is the key difference between ROM and EEPROM?
d) What is the key difference between RAM and EEPROM?
e) Comparing SRAM and DRAM, describe one advantage of each relative to the other.
5. Where should the stack pointer be initialized?
6. For both questions below, assume the stack pointer contents are initially $3FF0
a) What addresses are filled by the PSHD instruction? What value is in the stack pointer after
this instruction?
b) What addresses are read from by the PULX instruction? What value is in the stack pointer
after this instruction?
7. Complete the following steps to construct a program that will copy values stored in memory
beginning at $2200 to memory locations beginning at $2400, continuing to the next memory
address until a data value of $FF is found. This must be done individually; the grader will be
watching for signs that programs have been shared between students.
a) Plan your algorithm using pseudocode. Turn in your pseudocode with this homework.
b) Write the program in assembly, assemble the code and correct any syntax errors. Include
directives to store the data below at the specified addresses. Turn in the .LST file of the final
program.
$2200 $AA
$2201 $BB
$2202 $CC
$2203 $FF
$2204 $EE
c) Use an assembly simulator to verify your code works correctly. Include in your homework
a comment about what you observed during simulation to prove your program worked
correctly.