Question: HELP EXPERTS ONLY NEED QUESTION 1 ! Write an assembly program to do a binary search on the wordlist provided in the included .cpp file.
HELP EXPERTS ONLY NEED QUESTION 1 !
Write an assembly program to do a binary search on the wordlist provided in the included ".cpp" file. The ".cpp" file calls the function with specific words designed to test your algorithm. Your assembly program should also count the number of steps required (i.e. how many strcmp calls you need to make) and track which element in the array that has the word. Return -1 if the word is not in the list. The binary search routine should first check the endpoints (the wordlist is a fixed length, 75 words I believe) and then the middle. If not found, cut the list in half and try again until the address of the start of the list greaterthanorequalto the address of the end of the list. The example shows you how to access the parameters and the word list. Remember, it is an array of character pointers, so each element in the word list array is 4 bytes (i.e. a pointer to the word itself). You will also need to implement a "strcmp" function to check if the words match. Embed the subroutine within your inline assembly code. You are welcome to set up a common stack frame or do a "fast" call by carrying the respective values in the registers. Deliverables: Hard copy of your assembly source code. Screenshot of the output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
