Question: Create functions in MIPS and use these functions to add two arrays (element-by-element addition) and prints their sum . The two arrays are: Array1 =

Create functions in MIPS and use these functions to add two arrays (element-by-element addition) and prints their sum. The two arrays are:

Array1 = 2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20

Array2 = -1 | 0 | 1 | -2 | 0 | 2 | -3 | 0 | 3 | -4

All functions must follow the calling conventions discussed in class, which are as follows:

Use the jal instruction to call a function

Use jr $ra to return back to the caller.

Use the four $a registers to pass arguments to a function.

Use the two $v registers to return values back to the caller.

For clarity and consistency, prefer lower-numbered registers like $a0 and $v0 before using higher-numbered ones.

The eight $s registers are saved registers. A function should save the values of these registers to the stack if it will overwrite their values, and restore them before returning to the caller.

The ten $t registers are temporary registers. A caller should save the values of these registers to the stack before calling a function if they will still be needed after the function returns, at which point it should restore them.

Please refer to the screenshot below for more details. Part CCreate functions in MIPS and use these functions to add two arrays

Homework 3 pdf My Pitt Home \ e Chegg Study Guided S: / D Lab 4.pdf (--> d Secure | https://coursewebpitt.edu/bbcswebdav/pid-240601 91-dt-content-rid-22008127 2/courses/2181 UPITT CS 0447 SEC1070/Lab%204.pdf Lab 4.pdf ng Two Arrays using unction Create functions in MIPS and use these functions to add two arays (element-by-element addition) and prints their sum. The two arrays are: Array 21416|1 14 I 16118120 Array2-110111-210121-310131-4 You may initalize amayI and amy 2 using the word directive in your peogram's data section Print out the cdements of the sum in a single line, labeled and with values sxparaled by spaces. The linc should be terminated by a a character. The ouput will look like The sum is: 1476 10 14 11 1621 16 You can use it to check the output of your program! All tunctions must follow the calling conventions diseussod in class, which are as follows .Use the ja instruction to call a function * Use jr ra to return back to caller Use the four $a registers to pass arguments to a function. Use the two Sv rgisters to return values back to the caller For clanty and consistency, prefer lower-numbered registers like Sa) and Svo before using higher-numbered ones. The cight Ss registers are "saved registers." A fnction should save the values of these registers to the stack ifit will overwrite their values, and restore them before retuming to the ealler The ten $t registers are "temporary registers. A caller should save the values of these registers to the stack before calling a function if they will still be needed afber the function returns, at which point it should restore them. Save your answer as "lab4 Cas 12:00 PM 1022017 lype here to search 70%A Homework 3 pdf My Pitt Home \ e Chegg Study Guided S: / D Lab 4.pdf (--> d Secure | https://coursewebpitt.edu/bbcswebdav/pid-240601 91-dt-content-rid-22008127 2/courses/2181 UPITT CS 0447 SEC1070/Lab%204.pdf Lab 4.pdf ng Two Arrays using unction Create functions in MIPS and use these functions to add two arays (element-by-element addition) and prints their sum. The two arrays are: Array 21416|1 14 I 16118120 Array2-110111-210121-310131-4 You may initalize amayI and amy 2 using the word directive in your peogram's data section Print out the cdements of the sum in a single line, labeled and with values sxparaled by spaces. The linc should be terminated by a a character. The ouput will look like The sum is: 1476 10 14 11 1621 16 You can use it to check the output of your program! All tunctions must follow the calling conventions diseussod in class, which are as follows .Use the ja instruction to call a function * Use jr ra to return back to caller Use the four $a registers to pass arguments to a function. Use the two Sv rgisters to return values back to the caller For clanty and consistency, prefer lower-numbered registers like Sa) and Svo before using higher-numbered ones. The cight Ss registers are "saved registers." A fnction should save the values of these registers to the stack ifit will overwrite their values, and restore them before retuming to the ealler The ten $t registers are "temporary registers. A caller should save the values of these registers to the stack before calling a function if they will still be needed afber the function returns, at which point it should restore them. Save your answer as "lab4 Cas 12:00 PM 1022017 lype here to search 70%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 Databases Questions!