Assignment 10, due July 25
Part of
the homework for 22C:60, Summer 2005
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated, and unless there is what insurance companies call "an act of God" - something outside your control; the only exceptions to this rule will be by advance arrangement.
a) Ignoring problems of separate assembly, but using the tools discussed in chapter 12, write the code of the BOUNDS routine. (1 point)
b) Now, assume that you want to write BOUNDS as part of a separately assembled source file. Present a design for the interface to this separate module. Among the things your design must answer are: How does the BOUNDS routine learn the dimensions of the screen? How does the handler get attached to the BNDCHK exception? And, of course, before you actually answer this question, you must determine what it means to present a design for an interface, as opposed to presenting the interface itself. (1/2 point)
a) How many of these illegal instructions include space in them for two 4-bit arguments? (1/2 point)
b) (1/2 point) Given an example, in hexadecimal, of a halfword assembly directive that will assemble to produce one of these illegal instructions, with the two 4-bit argument fields both set to zero.
c) Give a macro called ILLEGAL that has two integer arguments, so that if you assemble it, it will create the illegal instruction you identified in part b and encode your two integers in the two available 4-bit argument fields of this instruction. (1/2 point)