CS 273

Homework 3

Due Monday, October 1, 2001

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 the Book

from page 109-110

from page 143-144

Not From The Book

Assembly of program

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

Disassembly of program

Here's a little bit of HC11 machine code. All numbers are hexadecimal
AddressContents
f80086
f8010c
f802f6
f803f9
f80400
f8051b
f806d7
f80712

   .
   .
   .
   

AddressContents
f90012

   .
   .
   .
   

AddressContents
fffef8
ffff00
  1. (5 points) Disassemble the code (the first byte I gave you is an instruction op code).
  2. (15 points) 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, the condition codes (that we know about), and any RAM locations that change as a result of the instruction. Use the reset vector to indicate the contents of where the PC will start. Use a question mark to denote a register or a bit whose values you don't know yet.


Last modified: Mon Sep 24 10:30:49 MST 2001