Question: C code to ARM assembly! The following C code computes the summation 3n3 as n goes from 4 to 7 Each term is computed with
C code to ARM assembly! 
The following C code computes the summation 3n3 as n goes from 4 to 7 Each term is computed with a function call that returns a value, which is then accumulated in a final sum in the main program. Convert this code to its assembly language equivalent, with a computeTerm method that is called four times and returns four values. For this assignment, use registers instead of variables. Use register 8 to hold the final summation. int main() { int ti, t2, t3, t4 t1 = computeTerm (4); t2 = computeTerm(5); t3 = computeTerm(6); t4 = computeTerm(7); final = ti + t2 + t3 + t4; 1/ 3(4) 3 // 3(5)3 // 3(6)3 // 3(7)3 } int computeTerm (int al). // Note - pass by value by placing argument in RO { return 3*al*al*a1; // Note - return by leaving result in R }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
