EE 308

Homework Assignment 3
Due Feb. 4, 1999

  1. Consider the program of Figure 1 of Lab 3.
    1. Hand assemble this program. Determine the hexadecimal numbers which will be generated when this program is assembled, and at what locations they will be stored in the HC11. For example, the first instruction ldaa #12 will result in
          addr    code
         0x0800   0x86
         0x0801   0x0C
      
    2. How many instruction cycles will it take the HC12 to execute this program? How long will this take on an HC12 with an 8 MHz E-clock?

  2. Consider the program of Figure 3 of Lab 3. How many instruction cycles will it take to execute this program? How long will this take on your EVBU?

  3. Dissassemble the following machine code into 68HC12 assembly instructions. Use Table A-2 of the CPU Reference Guide.
    96 80 7a fa 84 40 c3 7a fa fa 97 41

  4. Which of the conditional branch instructions in the following list will cause a branch to be taken if the condition flags N = C = 1 and Z = V = 0?
    1. BCC label
    2. BNE label
    3. BGE label
    4. BGT label
    5. BHI label
    6. BMI label

  5. Write a program to swap the last element of an array with the first element, the next-to-last element with the second, etc. Assume the array has 0x20 8-bit numbers, and that the array starts at address 0x0900.

  6. Write a program to determine the number of negative numbers in an array. Assume the array starts at address 0x8000 and ends at 0x9FFF.


Bill Rison, <rison@ee.nmt.edu >