I wrote a function in 68000 assembly that prompts the user to enter the size of a list then prompts them to enter each number and store it in the list. Function screenshot.
Now I want to write a second function to "search" through the list to find the maximum, minimum and average values of the list and store them. I know how to go about it in other languages with certain algorithms, but I can't figure out how to compare each value to find what I am looking for and just need someone to point me in the right direction.
You already have a piece of code that walks the list (which is rather an array in your case). Some pseudo code could be
Note the loop counter (you already have that in your input code) is not shown here, that would be an exercise of your own. The code works by initializing the registers holding the minimum value with the maximum possible and the maximum with the minimum possible, then checking for each entry whether the current one is bigger/smaller than the biggest/smallest so far and replacing it, if yes.