EE 308

Homework Assignment 3
Due Feb. 7, 2001

  1. 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

  2. Repeat Problem 1 for the following machine code:
    CF 0C 00 D6 6F C4 03 C1 03 26 02

  3. 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

  4. The contents of a 68HC12's registers are:
     A   B     X     Y    SP    PC  CCR
    12  34  ABCD  5678  0A20  0800   F5
    Consider the following instruction sequence:
        org   $0800
    What will be in the registers after the four instructions have been executed?

  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 non-negative numbers in a table. The starting address of the table is 0xa000 and the ending address is 0xdFFF. Each element in the table should be considered to be an eight-bit signed number. Save the answer at address 0x0900. (Do you need an eight-bit or 16-bit variable to store the answer?)

Bill Rison, < >