I'm trying to figure out a way to store the min and max of 10 numbers that are input by the user. I'm not searching through an array of numbers but rather I want to compare each input number that comes in before I add it to the other numbers. The code I made below will add all the input numbers together and then subtract to get the average, but I also want to output the min and max, and I'm not sure how to do that.
The numbers that will be input are: 10 20 30 40 50 60 70 80 90 100.
So currently the code only outputs the average which is 55
ORG 100
LOOP, LOAD X /counter
SUBT TEN
SKIPCOND 000 /if X = 10
JUMP LOOP2 /take average after X = 10;
CLEAR /BEGIN INPUTING NUMBERS FOR AVERAGE
INPUT
ADD Y /add Y to the input
STORE Y /save new value
CLEAR
LOAD X /INCREMENT COUNTER
ADD ONE
STORE X
CLEAR
JUMP LOOP /RESTART LOOP
LOOP2, LOAD Y /LOAD ALL THE ADDED NUMBERS
SKIPCOND 800 /WHEN Y = 0
JUMP PRINT /GO TO OUTPUT
SUBT TEN /SUBTRACT 10 UNTIL REACH 0
STORE Y /STORE NEW NUMBER
CLEAR
LOAD AVERAGE /EACH LOOP ADD 1 TO AVERAGE
ADD ONE
STORE AVERAGE
CLEAR
JUMP LOOP2
PRINT, LOAD AVERAGE
OUTPUT
HALT
TEN, DEC 10
ONE, DEC 1
X, DEC 0 /USE TO INPUT 10 NUMBERS, COUNTER
Y, DEC 0 /ALL NUMBERS INPUT ADDED
MIN, DEC 0
MAX, DEC 0
AVERAGE, DEC 0 /AVERAGE OF Y DIVIDED BY X