Practice Exercise 8

  1. Write out the control points for the SUB instruction. Use the microprograms of Chapter 8 as a model.

  1. Write out the control points for the STD instruction.

  1. Explain what would have to be done to implement the RTL for any of the jump instructions of the CSC-1, for example, JZ:
If Z=1 then PC <- x
  1. There is no JNZ instruction. How could you simulate the effect of it?

  1. There is no CLR (clear) instruction in the CSC-1 instruction set. Explain how this could be implemented.

  1. Operating system programmers often need a SWAP instruction which, in one single uninterruptible instruction, can exchange the value in A with the indicated word of memory. In effect, it does both a load and a store in one single instruction. The assembler format is
           SWP x
where x is an address of memory. Write the RTL statements that would do this.
  1. The RTL of question 6 seems to imply an impossible task. List two ways it can be accomplished.

  1. Compare the organization of the CSC-2 shown of Chapter 8 to the CSC-1 computer. Write down 1 pro and 1 con of this organization with regards to the CSC-1 organization. That is, list one way it is better and one way it is worse.

  1. Write out both the RTL and the control points for the STS instruction for the CSC-2 computer, using the ADD instruction as a model.