;====================================================================
; Main.asm file generated by New Project wizard
;
; Created: Ср апр 19 2017
; Processor: 8086
; Compiler: MASM32
;
; Before starting simulation set Internal Memory Size
; in the 8086 model properties to 0x10000
;====================================================================
CODE SEGMENT PUBLIC 'CODE'
ASSUME CS:CODE,DS

START:
mov cx,0
mov AX,DATA
mov DS,AX
lea SI,X
mov dl,0
mov bl,[si]
h:
inc cx
cmp bl,[si+2]
jg Max
mov bl,[si+2]
mov indexMax,dl
mov dl,indexMax
Max:
add si,2
inc dl
cmp cx,len
jne h
ENDLESS:
JMP ENDLESS
CODE ENDS
DATA SEGMENT PUBLIC PARA 'DATA'
X DW 5,6,7,2,3,4,15,1,2,8
indexMax DB ?
len=$-X
DATA ENDS
END START