运行出错
程序代码:
data segment a dw 7,1,3,5,4,2,8,6 n dw 8 data ends program segment main proc far assume cs:program,ds:data start: push ds mov ax,0 push ax mov cx,n dec cx loop1: mov di,cx mov bx,0 mov si,0 loop2: mov ax,a[bx] cmp ax,a[si] jge cotinue mov si,bx cotinue: add bx,2 loop loop2 mov ax,a[bx] xchg ax,a[si] mov a[bx],ax mov cx,di loop loop1 mov ah,09 int 21h mov ah,4ch int 21h main endp program ends end start
obj跟link的时候都没事,只是在运行exe的时候就出错了,这是为什么