Question: Write a MIPSzy subroutine, power, that accepts 2 arguments x and y and computes x y . You can assume that x and y are

Write a MIPSzy subroutine, power, that accepts 2 arguments x and y and computes x y . You can assume that x and y are both larger than 0. The main program passes the two parameters and receives the return value through the program stack.

Test subroutine with the following

(show comments also)

Write a MIPSzy subroutine, power, that accepts 2 arguments x and y

addi Sto, $zero, 5100 top lw St1, 0(Sto) beq t1, $zero, done addi $sp, $sp, -4 sw $t1, 0(Ssp) addi $t2, Szero,4 addi $sp, $sp, -4 sw St2, 0(Ssp) addi $sp, $sp, -4 jal power sw $t3, 0(Sto) addi $sp, $sp,12 addi tO, St0, 4 j top power: Put your subroutine here done: nd memory configuration: 5100 5104 2 5108 3 5112 5 5116 2 5120 1 5124 0

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 Databases Questions!