Home / Expert Answers / Computer Science / 12-12-zylab-1-alu-and-data-transfer-instructions-given-an-array-of-2-integers-write-a-program-to-pa662

(Solved): 12.12 Zylab 1 - ALU and Data Transfer Instructions Given an array of 2 integers, write a program to ...



12.12 Zylab 1 - ALU and Data Transfer Instructions Given an array of 2 integers, write a program to implement the following C code that appends elements to the array: ``` // Declaration of va=iablea int* A, // Integer array A with the hase addrese pointing to variahie A int a; char b, c, ahort d; // Appand arxay elementa { A[3], A[2] ; - A[1] * A[0], A[4] - A[2] / 230; a - A[2] & 230; b - a >> 16; // ">>" - =ight ahift c-as 8; // 'E' - hit-wise and d - a << 2; // '<<' - left ahift A[3] - (b, c, d}; // :} - concatenation ``` You may use any temporary registers from \$10 to \$19 or saved registers from \$s1 to \$s7. Clearly specify your choice of registers and explain your code using corrments ( 5 points). Example Test: If the values of \$s1 through \$s7 are initialized in the simulator as: the resultant array is: Note Use the '+' button under the Registers display to initialize register values for \( \$ 80 \) and the '+' button under the Memory display to initialize the first two array elements.



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe