Question: Given an array of 2 integers, write a MIPS program to implement some ALU operations and store the results back to memory. The C code
Given an array of integers, write a MIPS program to implement some ALU operations and store the results back to memory. The C code below shows how the elements are appended to the array:
Declaration of variables
int A; Integer array A with the base address pointing to variable A
int a; char b c; short d;
Append array elements
A A A A; concatenation append. bit product should be stored in Array
A A;
a A;
b a ; right shift
c a & bb b; & bitwise and
d a ; left shift
Ab c d; concatenation append. Use Memory Operations identify the correct address to place, c and d in Array
AA AA A A;
Registers Variables
$s A
Addresses Contents
$s A
$s A
You may use any temporary registers from $t to $t or saved registers from $s to $s Clearly specify your choice of registers and explain your code using comments points
Example Test: If the value of $s and Memory are initialized in the simulator as below: Use the button under the Registers display to initialize register values for $s and the button under the Memory display to initialize the first two array elements.
Registers Data
$s
Addresses Contents
The resultant array is:
Addresses Contents
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
