主题:初学汇编
data segment
stu dw 12,34,9,10,45,88,79
max dw ?
at dw ?
mes1 db 13,10,'max=$'
data ends
prog segment
main proc far
assume csrog,ds:data,es:data
startush ds
sub ax,ax
mov ds,ax
push ax
mov ax,data
mov ds,ax
mov es,ax
mov cx,7
mov bx,0
mov ax,stu[bx]
loop1:
dec cx
cmp cx,0
je input
add bx,2
mov dx,stu[bx]
cmp ax,dx
ja loop1
jb change
change:
mov si,8
sub si,cx
xchg ax,dx
jmp loop1
input:
mov max,ax
mov at,si
lea dx,mes1
mov ah,9
int 21h
lea dx,max
mov ah,9
int 21h
lea dx,at
mov ah,9
int 21h
mov ah,4ch
int 21h
main endp
prog ends
end start
[img]http://images.blogcn.com/2005/11/27/9/forever406,20051127164158.jpg[/img]