求改一道排序题,谢谢。
assume cs:code,ds:data,ss:stackdata segment
A db 32,44,1,34,56,7,42,8,96,31
data ends
stack segment
db ?
stack ends
code segment
start: mov ax,data
mov ds,ax
mov ax,stack
mov ss,ax
mov bx,0
mov cx,8
mov si,0
mov al,0
s: push cx
push bx
sub cx,si
s3:
mov al,[bx]
cmp al,[bx+1]
ja s1
inc si
pop bx
pop cx
loop s
s1: xchg al,[bx+di]
xchg [bx],al
inc bx
loop s3
mov ax,004ch
int 21h
code ends
end start
编译与连接都成功了。为什么 结果不对呢。