Question: Hello I need some help with my assembly language homework. The language is MIPS The following tasks, in order: Allocate a global array ( i.e.
| Hello I need some help with my assembly language homework. The language is MIPS The following tasks, in order: |
| Allocate a global array (i.e., space in the data segment) enough for storing 5 integers and initialize the array (from 1st to 5th element) with 44, 99, 33, 11 and 55 at the same time (i.e., DON'T first allocate uninitialized space for array and later write code to put the values into array). |
| Display a labeled output about the array's initial contents (from 1st to 5th element). |
| Re-order the values in the array so that the contents of the array in memory (from 1st to 5th element) becomes 11, 55, 33, 44 and 99, using the following operations in the order listed (to not defeat the goals of this exercise, you must NOT change the specified operations and order, even if doing so will accomplish the same effect more efficiently): |
![]() | Swap the contents in memory of the 1st and 4th elements of the array. |
![]() | Swap the contents in memory of the 2nd and 5th elements of the array. |
| IMPORTANT (for the purpose of this exercise): |
| When performing each of the swapping operations above, you can re-use the array's base address in register (loaded when performing an earlier operation) but you MUST re-load the values of the associated array elements fresh from memory (i.e., assuming no knowledge that certain values might have already existed in some registers due to prior operations). |
| Display a labeled output about the array's contents (from 5th to 1st element) after the 2 swapping operations above. |
![]() | NOTE: It is from 5th to 1st element and not from 1st to 5th element. |
| IMPORTANT (for the purpose of this exercise): |
| When displaying the after-swap labeled output, you can re-use the array's base address in register (loaded when performing prior operations) but you MUST re-load the values of the array elements fresh from memory (i.e., assuming no knowledge that certain values might have already existed in some registers due to prior operations). |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts



