I create this program for viewing the max and min number in an array, I want to print the position of these too, how I can do this? For example if I give in input 1234567895, I want in output max=9 position=8, min=1 position=0. At the moment max and min works but I don't know how to print indices for outputting the position
dosseg
.model small
.stack 100h
.data
vettore db 10 dup(0)
msg1 db 'insert 10 numbers',10,13,"$"
msg2 db ' Min:',"$"
msg3 db 'Max:',"$"
.code
start:
mov ax,@data
mov ds,ax
lea dx,msg1
mov ah,9
int 21h
mov di,0
inserimento:
mov ah,1
int 21h
mov vettore[di],al
add di,1
cmp di,10
jl inserimento
mov di,0
mov si,0
mov bl,'9'
jmp testz
b:
mov bl,vettore[di]
cmp di,10
jge finee
jmp testzzz
a:
mov cl,vettore[di]
cmp di,10
jge finee
jmp testzz
testz:
cmp vettore[di],cl
jge a
testzz:
cmp vettore[di],bl
jl b
testzzz:
inc di
inc si
cmp di,9
jle testz
finee:
lea dx,msg3
mov ah,9
int 21h
mov ah,2
mov dl,cl
int 21h
lea dx,msg2
mov ah,9
int 21h
mov ah,2
mov dl,bl
int 21h
fine:
mov ah,4ch
int 21h
end start