EE 308
Homework Assignment 3
Due Feb. 9, 2000
- 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
- Repeat Problem 1 for the following machine code:
CF 0C 00 D6 6F C4 03 C1 03 26 02
- 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?
- BCC label
- BNE label
- BGE label
- BGT label
- BHI label
- BMI label
- 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?
- 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.
- Write a program to determine the number of negative numbers in an
array. Assume the array starts at address 0x8000 and ends at 0x9FFF.
- 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 >