Question: 1. [20 pts] Write an assembly function equivalent to the fllowing C funcion The function es all short integers of array X1l to 12 bits.
1. [20 pts] Write an assembly function equivalent to the fllowing C funcion The function es all short integers of array X1l to 12 bits. Use SSA T instruction zoid ssat12Array (short x(], int N) int i: for (int i=0; i 2047) x( 2047; 2. 120 pts] Write an assembly function equivalent to the following C fiunction. The function calculates the dot product oftwo vectors (arrays) Note that the array elements are"short int" and the result is "int int dotPxoduct (short xt1, ahort Yt, int N int ii int result 0; result +=x( * Y ); return result; 3. 120 pts] Write an assembly function equivalent to the following C finction. The function counts the occurrences of a character in a C string. You are suggested to use conditional execution to translate the if-statement inside the while loop countChac(const char ,str, char sh) int count ; char ch2 while ((ch2 str) 0) if (ch2-- sh) count++ return count
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
