Write, run, and test a MARIE assembly language program.The program should allow the user to input 8 numbers and find the smallest and the largest. The program should then print the smallest number and the largest number. Numbers are limited to integers, and can be positive, negative, or zero. You do NOT have to prompt input or label output.
ORG 100 / Calculation of the maximum
Load First /loading 1st array member
Store Next /address of next pointer,stores
Load Array /Loading 1st element
Store Max /maximum value with 1st element
Loop, Clear
AddI Next /Load next element!
Subt Max /Comparing with the maximum once
Skipcond 000 /If negative ->skip
Jump NewMax /If not negative ->max value
NextIdx, Load Next
Add One /pointer++
Store Next
Load Count /counter--
Subt One
Skipcond 800 /counter is positive ->same proceeding
Jump Print /else - printing the result
Store Count /counter decresed and stored
Jump Loop
NewMax, Clear / new maximum value
AddI Next
Store Max
Jump NextIdx
Print, Load Max
Output
Halt /Terminate program
First, Hex 11E /starting is location 11E(change as per...,as code changes don't forget to change it too)
Next, Hex 0 /next element index (memory location)
Max, Dec 0 /maximum value
Count, Hex 8 / loop counter decreases
One, Dec 1 /Loop stops
Array, Dec -5
Dec 15
Dec -17
Dec 20
Dec -23
Dec 12
Dec 130
Dec -12
I am trying ti print minimum and maximum value. This will print only max value. Can anyone help me out to make it print minimum value from the given array.