EE 308

Homework Assignment 3
Due Feb. 9, 2000

  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 = V = 1 and Z = C = 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
    55  AA  1234  5678  0A00  0800   F0
    
    Consider the following instruction sequence:
        org   $0800
        PSHX
        PSHY
        PULA
        PULB
    
    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 negative numbers in an array. Assume the array starts at address 0x8000 and ends at 0x9FFF.

  7. Write a program to determine the number of negative numbers in a table. The starting address of the table is 0x8000 and the ending address is 0xBFFF. 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, <rison@ee.nmt.edu >