Read text pp 77-84; read section 2.4, 3.1, the Motorola freeware assembly manual from the lab notes (this has much the same content as section 3.2, but is specific to our particular assembler).
Please remember - how you get your answers is at least as important as the answers themselves. Show all your work. If you do not show your work, you get no credit.
For this homework, work alone! Much of this assignment will be simular to your midterm.
from page 109-110
from page 143-144
(10 points) Write a program section to exchange the numbers in the A and B accumulators. At the beginning of the section load accumulator A with the value $24 and load accumulator B with the value $12. The first instruction for this program section should start at address f800; a section of ram must be used to temporarily hold one of the two accumulator's value during the exchange. Don't forget to set your reset vector.
(20 points) Hand assembly your program into a memory table. Suppose you were to execute this code, starting at the first instruction and continuing through the last one. At the conclusion of each instruction, write down the values in the PC, the A register, the B register, and any RAM locations that change as a result of the instruction.
Here's a little bit of HC11 machine code. All numbers are hexadecimal
Address | Contents |
---|---|
f800 | 86 |
f801 | 0c |
f802 | f6 |
f803 | f9 |
f804 | 00 |
f805 | 1b |
f806 | d7 |
f807 | 12 |
. . .
Address | Contents |
---|---|
f900 | 12 |
. . .
Address | Contents |
---|---|
fffe | f8 |
ffff | 00 |
Last modified: Mon Sep 24 10:30:49 MST 2001