Find the largest element in a block of data. The length of block is 0A H. Store the maximum value in memory location result. Use an Assembly Language Program for Intel 8086.

Read More


title largest element in a block of data


.model small

.stack 100H


main proc

mov ax, @data ; initialize ds register

mov ds, ax


mov cx, OA H ; counter = 10

mov al, 00H ; assume the largest number is 00H

mov SI, offset array ; SI initialization

BACK:    cmp al, [SI] ; is next number > maximum

jnc AHEAD ; NC = 0

mov al, [SI] ; yes, replace maximum


loop BACK

mov result, al ; move final result to al


mov ax, 4C00H ; return to DOS

int 21H

main endp


array db 12, 13, 80, 14, ….. ; total 0A h variables

result db ?

end main