Question: The procedure below uses 3 numbers stored in $ a 0 , $ a 1 and $ a 2 . addi s p , sp

The procedure below uses 3 numbers stored in $a0,$a1 and $a2.
addi sp,sp,-4
sw sp)
add t0,a0,$a1
add v0,t0,$a2
1w sp)
addi sp,sp,4
jr $ra
(a) Write RTN comments by the side of each instruction describing its functionality.
(b) What is the code doing?
(c) Write a procedure Add4 that calls this one to add 4 numbers.
The procedure below uses 3 numbers stored in $ a

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