.386
dseg segment
data dd 7fffffffh,6fffffffh,5fffffffh
len = 3
td = 4
dseg ends
sseg segment stack
db 128 dup(0)
sseg ends
cseg segment
assume ds:dseg,cs:cseg,ss:sseg
start:
mov ax,dseg
mov ds,ax
mov cx,len-1
loop1:
push cx
mov dl,0
mov bx,8
loop2:
mov eax,data[bx]
cmp eax,data[bx-td]
jge okey
xchg eax,data[bx-td]
mov dl,1
mov data[bx],eax
okey: sub bx,td
loop loop2
pop cx
cmp dl,0
jz sorted
loop loop1
sorted:
mov dl,41h
mov ah,02h
int 21h
mov ah,01h
int 21h
mov ah,4ch
int 21h
cseg ends
end start
可以运行,但是为什么排序后什么都显示不了,(现在改成排序后读入一个字符,但是运行EXE后直接就出来了,好像SORTED后的没有执行,为什么啊