问题
从包含10个无符号数的字节数组array中选出最小的一个数存于变量MIN中,并将该数以十进制形式显示出来。
代码
data segment
arrey db 0,1,2,4,6,5,7,9,8,3,5
min db 0
data ends
code segment
assume cs:code,ds:data
main proc far
start:
mov ax,data
mov ds,ax
mov si,0
mov min,0
mov cx,10
L1:
mov dh,arrey[si]
cmp min,dh
jae L2
mov min,dh
L2:
inc si
loop L1
mov dl,min
add dl,30h
mov ah,02h
int 21h
mov ax,4c00h
int 21h
main endp
code ends
end start