Question: Inspect the following program sample1.s , execute it on your virtual machine and answer the following questions What does line 17 to 19 do? (Use

Inspect the following program sample1.s, execute it on your virtual machine and answer the following questions

  1. What does line 17 to 19 do? (Use Appendix A of the Patterson reference or Application Help in QTSpim to find meaning of the commands).
  2. On line 18, why is register $a0 used? Are there other registers that could be used or not? If so, which ones?
  3. Modify the given assembly program so that it computes a value
    • Create a copy of sample1.s
    • Modify it so that it computes a rectangle's perimeter as defined by the following formula ..... 2w + 2l, where w = 10 and l = 15. The program should print "your name: student number": w = 5, l = 10, perimeter = 50. The program must calculate the perimeter using the formula.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!