麻烦大家再看看这个错在哪里?
用冒泡排序法将数从大到小排列,并显示出来。
DSEG SEGMENT
DATA DB 41H,42H,43H,44H,45H,46H,47H,48H,49H,4AH
DSEG ENDS
CSEG SEGMENT
ASSUME CS:CSEG,DS:DSEG
START:MOV AX,DSEG
MOV DS,AX
MOV CX,09H
MOV SI,OFFSET DATA
NEXT1:MOV DI,CX
NEXT2:MOV AL,[SI]
CMP AL,[SI+1]
JNBE NEXT3
XCHG AL,[SI+1]
MOV [SI],AL
NEXT3:INC SI
LOOP NEXT2
MOV CX,DI
LOOP NEXT1
MOV CX,10
MOV SI,OFFSET DATA
OUTPT:MOV DL,[SI]
MOV AH,02H
INT 21H
INC SI
LOOP OUTPT
MOV AH,4CH
INT 21H
CSEG ENDS
END START
汇编链接都正确,但运行就出问题,我实在看不出哪错了,麻烦知道的朋友告诉下。
[此贴子已经被作者于2007-6-16 18:51:47编辑过]