;排序,并显示
dseg segment
a db 2,7,9,3,1
c equ $-a
dseg ends
assume cs:cseg, ds:dseg
cseg segment
start:
mov ax, dseg
mov ds, ax
mov cx, c
xor bx, bx
lea si, a
m0:
mov al, [si]
cmp al, 5
jle m1
inc bx
m1:
inc si
loop m0
mov ax, bx
call print
mov ax,4c00h
int 21h
print proc near
xor cx, cx
mov bx, 10
Q0:
xor dx, dx
div bx
xor dx, 0e30h
inc cx
push dx
cmp ax, 0
jnz Q0
Q1:
pop ax
int 10h
loop Q1
ret
print endp
cseg ends
end start