Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 2 . 1 2 Zylab 1 - ALU and Data Transfer Instructions Given an array of 2 integers, write a MIPS program to implement
Zylab ALU and Data Transfer Instructions
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started