DATA SEGMENT
S DB 12,36,14,25,9,23
X DB 1
FLEG DB 0
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
BEGIN: MOV AX,DATA
MOV CX,DX
LEA SI,S
MOV CX,6
MOV FLEG,0
AGAIN: MOV BX,CX
DEC BX
A: CMP [SI],[SI+1]
JB N1
JNB N2
N1: XCHG [SI],[SI+1]
MOV FLEG,1
CMP BX,0
JZ F1
INC SI
DEC BX
JMP A
N2: CMP BX,0
JZ F1
INC SI
DEC BX
JMP A
F1: CMP FLEG,0
JZ OVER
JNZ OVER1
OVER1: LEA SI,S
ADD SI,SI+1
INC X
MOV FLEG,0
LOOP AGAIN
OVER: MOV DX,OFFSET S
MOV AH,09H
INT 21H
MOV AH,4CH
INT 21H
CODE ENDS
END BEGIN
第15 18 35行出错,我快要疯拉