Question: Write a LC 3 - program to do a linear search for a key in an unsorted array. The number to search can be found
Write a LCprogram to do a linear search for a key in an unsorted array. The number to search can be found at label key
and should be stored in register R The number of elements in the array, found at label n
should be loaded into register R and the address of the start of the array, given by label data
should be stored in register R Your program should determine the position of the key in the array which is a value between to n if it exists and store this position in register R If the key is not in the array, store in register R
You can use the following of LC code as a starting point for your program. When handing in use the data provided in the template. You DO NOT need to validate your inputs that is assume the inputs are valid
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
