Homework 10

22C:18, Spring 1996

Due Tuesday Apr. 23, 1996 in discussion

Douglas W. Jones

  1. What output do you expect from the following bit of code for the calculator assigned in MP6:
    	V(1)=7 LV(1)>1 (IV(1)%2=0 V(1)=V(1)/2 EV(1)=V(1)*3+1 PV(1))
    

  2. Look at the exception vector table in figure 13.1 and the definitions of the CHK and CHK2 instrucitons, what purpose would you expect a compiler to use these instructions for in a user program. Demonstrate this by giving a very simple example of a snippet of Pascal code and the machine instructions you would expect a compiler to produce.

  3. Look at section 13.6 in the book on the trace exception and describe how you would expect the trace trap service routine to operate.

  4. Explain figure 12.5 -- that is, what are these registers and how do their contents relate to anything we have studied up to this point?