Computer Science In visual studio, convert the following binary search function to (.asm) Assembly Language Code: int binary_search(int sorted_list[], int low, int high, int element) { int middle;...


Computer Science


In visual studio, convert the following binary search function to (.asm) Assembly Language Code:



int binary_search(int sorted_list[], int low, int high, int element)



{



    int middle;



    while (low <=>



    {



        middle = low + (high - low)/2;



        if (element > sorted_list[middle])



            low = middle + 1;



        else if (element <>



            high = middle - 1;



        else



            return middle;



    }



    return -1;



}



int main(void)



{



  int arr[] = { 2, 3, 4, 10, 40 }; // sorted array



  int n = sizeof(arr) / sizeof(arr[0]); // total number of elements



  int x = 10; // item that we are searching for



  int result = binarySearch(arr, 0, n - 1, x);



  return 0;



}



Please include comments, and a screenshot of the compiler.



Thank you!



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here