CSE 30: Homework 3
(Deadline: Wednesday, 21st April, 1999, 11:59pm)
(Extended Deadline: Wednesday, 28th April, 1999, 11:59pm)
1. Exercise 3.3
To run their programs on this data, students should put mov instructions
at the beginning of the program. They should run the program under
gdb in order to generate output. The gdb output should be generated
by putting in the label fin: at the end of the program, and then examining
the
contents of registers %l0-%l3.
Note: in this exercise you will be using the logic instructions from Chapter 3. You may need to use instructions introduced in chapter 4, namely the shift instructions on page 107.
Also define the following to stand for the registers that you use:
This exercise gives more practice with SPARC instructions and shows
how
xor and and instructions can be used to implement addition. The
program
should be run with gdb in order to generate output. Students
should put a
break in the loop and print out the partial results in the sum and
carry
registers, i.e. s_r = l2, and c_r = l3.