Question: Task #1 . Write a MIPS assembly program that that implements the read, reverse, and print functions used by f function in Figure 7.6 &

 Task #1 . Write a MIPS assembly program that that implements

Task #1 . Write a MIPS assembly program that that implements the read, reverse, and print functions used by f function in Figure 7.6 & Figure 7.7 in the PDF file. These functions should work with any size n (not only size 10). Then write a main function that calls function f. addiu $sp,$sp,44 #allocate stack frame 44 bytes SW Sra, 40($sp) # save Sra on the stack move Sae, $sp # $ae - address of array on the stack 11 Sal, 10 $ai - 10 jal read call function read nove sae, $sp # $ae address of array on the stack 11 $a1, 10 # $al - 10 jal reverse # call function reverse nove Saw, Ssp Sae - address of array on the stack 11 Sai, 10 # $a = 10 jal print call function print IM Sra, 40($sp) #load Sra from the stack addiu $sp,$sp,44 # Free stack frane - 44 bytes jr Sra return to caller Sample Run of the task Enter integer 1:1 Enter integer 2:2 Enter integer 3:3 Enter integer 4: 4 Enter integer 5:5 Enter integer 6:6 Enter integer 7:7 Enter integer 8:8 Enter Integer 9: 9 Enter integer 10:10 Integer reversed - 10987654321 05 Mar 21 Stack Frame saved Sra. 4 bytes Example function void ) int array(10); read(array, 10); reverse(array, 10): print(array, 10); int array[ie) (40 bytes)

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!