Program : Write an assembly program to find out the largest number from a given unordered array of 8-bit numbers that stored in the locations starting from a known address.
Solution :
Compare the number of the series with the (i+1 )th number by using CMP instruction. It will set the flags suitably, depending upon whether the ith number or the (i+1 )th number is higher. If the ith number is higher than (i+1 )th, leave it in register AX (any register can be used ). Or else, load the (i+1 )th number in register AX, replacing the ith number in AX. The process is repeated till all the members in the array have been compared.