食野苹

多个数比较大小

data segment

buffer db 2,8,9,5,4,0
data ends

code segment
assume cs:code,ds:data
main:
mov ax,data
mov ds,ax
mov si, offset buffer
mov al,[si]
again: or al,al
  jz ok
  mov bl,[si]
 or bl,bl
  jz ok
          inc si
         cmp al, bl
          jnc next
         xchg al,bl
next:    jmp again
ok: add al,30h
mov dl, al;显示
  mov ah, 2
  int 21h
mov ah,4Ch;终止当前程序并返回调用程序
 int 21h

code ends
end main

posted on 2011-07-27 16:40  nyc1893  阅读(373)  评论(0编辑  收藏  举报