Assignment 11, due Nov 14
Part of
the homework for CS:2630 (22C:60), Fall 2014
|
On every assignment, write your name legibly as it appears on your University ID card! Homework is due on paper Homework is due on paper at the start of class on the day indicated (usually Friday). Late work must be turned in to the TA's mailbox (ask the CS receptionist in 14 MLH for help). Never push homework under someone's door!
LEACC R3,X
as
qPCRELq = X-(.+6) LIS R1,qPCRELq >> 8 ORIS R1,qPCRELq & #FF PLUS R1,R0 MOVECC R3,R1
Here, we are asking about things you might have tried in solving MP5 that do not work.
a) Why can't we replace PLUS R1,R0 / MOVECC R3,R1 with ADD R3,R1,R0? (Hint: Find out why the ADD instruction produces a completely different result.) (0.3 points).
b) It would be nice to shorten the LIS / ORIS instruction to just an LIS if the value of qPCRELq is between -128 and +127, but this produces big problems when you try to do it. Why? (Hint: The answer has more do with the assembler than with the Sparrowhawk.) (0.4 points).
![]() |
Two new inputs have been added to this flipflop, labeled X and Y.
a) How must the X and Y inputs be set so that this flipflop will behave exactly like the flipflop in the notes? (0.3 points)
b) Given that C is held constant at zero or one and X and Y are initially at the values you proposed for part a, what happens to the outputs if there is a pulse of the opposite value on the X input. (0.4 points)
a) It didn't really save and restore all the registers from R1 to R15. Which registers did the code actually save and restore? (0.3 points)
b) Why didn't the monitor's trap service routine need to save the other registers? (0.5 points)
COMMON BUSTRAP, EXSIZE
The monitor would install a default exception handler for a bus trap exception before launching the user program. The default handler would output the exact same error message the monitor currently outputs, and then it would halt, exactly as the current monitor does. As a consequence of this change, users could install their own handler for this (and other) trap conditions.
There are two ways a trap handler in the monitor could transfer control to the handler:
a) Which would lead to faster trap handling? (0.3 points)
b) Is one of these solutions incorrect in any formal sense of the word? Why? You may need to read ahead in the notes to determine this. (0.5 points)