Question: Here is a function written in C, which finds the position of the first value of the array which equals val. If none of

Here is a function written in C, which finds the position of the first value of the array which equals val. If none of the values in the array equal val, it returns -1. int findval (int val, int array[], int size) { int i; // index into array for (i = 0; i < size; i if (array[i] return i; i+1) %3D val) return -1; } Please re-write this function in ARM Thumb assembly code, aiming for the fewest instructions. Let the inputs be RO=val R1=the memory address of the array R2=size And the output should be returned in R0
Step by Step Solution
3.48 Rating (151 Votes )
There are 3 Steps involved in it
To rewrite the given C function in ARM Thumb assembly language you should keep the loop and comparis... View full answer
Get step-by-step solutions from verified subject matter experts
