Question: Given the following C declarations: unsigned short X[]; unsigned short Y[]; int i; int do something (unsigned short X[], unsigned short Y[], int i);
Given the following C declarations: unsigned short X[]; unsigned short Y[]; int i; int do something (unsigned short X[], unsigned short Y[], int i); Assume 10 holds X, r1 holds Y, and r2 holds j. Note that the last statement is a declaration of a function prototype. The following questions are independent. a. [5 pts] Write assembly instructions equivalent to the following C code. Y[1] = X[0] + X[1]; b. [5 pts] Write assembly instructions equivalent to the following C code. You must use conditional branch. if (x[i]Y[i]) { } do something (X, Y, i); c. [5 pts] Write assembly instructions equivalent to the following C code. You must use conditional execution (no conditional branch). if (X[j] = 0) { Y[j] = 1; } else { Y[j] } = 0;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
