Question: Notice the supplied program snippet lays out data memory so the arrays are easily found and visually easy to see. Do not modify the array
Notice the supplied program snippet lays out data memory so the arrays are easily found and visually easy to see. Do not modify the array layout in memory as this will make your debugging and my grading easier.
You are to write a MIPS program in MARS that accomplishes the following tasks. Given arrays named arr1,arr2, arr3, arr4, arr5, arr6, arr7, and arr8: arr3 = arr1 + arr2 arr4 = arr1 - arr2 arr5 = arr1 + 4 arr6 = arr2 - 8 arr7 = values enterd by user arr8 = arr1 * arr2
These are element by element operations so arr3 = arr1 + arr2 means arr3[0] = arr1[0] + arr2[0] arr3[1] = arr1[1] + arr2[1] arr3[2] = arr1[2] + arr2[2] Do not use a loop but perform each task using straight line code.
For arr5 = arr1 + 4 do not load the constants into a register, instead use an immediate operation for each sum. Simialrly for the arr6 = arr2 - 8 task.
When you display arr1 to the I/O screen make sure you also output a message describing the output.
The multiplication will require you to use the mul and the mflo instructions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
