Assignment 11, due Dec 1

Part of the homework for 22C:40, Fall 2003
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Homework Due Dec 1

Do Chapter 12 Problems b, c, g, j, n, t.

Machine Problem Due Dec 10

Do problem q from Chapter 12 of the notes. Specifically, make the instruction

   1111dddd0000xxxx
   DDDDDDDDDDDDDDDD

operate as a register-to-memory add with the following semantics

   M[R[xxxx]+DDDDDDDDDDDDDDDD]  +=  R[dddd]
   PC = PC + 4

Note that the opcode 1111xxxx0000xxxx now causes an illegal instruction trap, so your solution will involve writing your own trap service routine. In your assembly language code, you will have to add code to the trap vector. This code can be written as:

OLDLC = .   ; save the current value of the assembly location counter
. = #20     ; starting address for handling illegal instructions
   ...
   ... your code to be added to the trap vector (no more than 16 bytes!)
   ...
. = OLDPC   ; restore the location counter

   ... your code outside the trap vector can go here

You must, of course, write a main program that demonstrates that provides a reasonable test of your trap handler. As usual, honest disclosure of known bugs in your code will be worth more credit than undisclosed or undiscovered shortcomings!

Turn in a well commented assembly listing that makes appropriate use of titles, subtitles etc. This must be printed in landscape format, with the assembler's number of lines per page set to the number of lines that actually fit on a landscape-format page, and with the font and tabs set properly so that the listing is legible!

The following demo shows how to assemble and print in landscape format from a Linux computer in room 301 MLH.

	smal -P 46 mp5.a
	lp -dp301 -o landscape mp5.a