【求助】主程序调用子程序,结果死在了第一个子程序上,高手帮忙看下
DATA SEGMENTBUFFER DB 30
ACTLEN DB ?
CHARS DB 30 DUP(20H)
INPUT DB 'please input 10 numbers:',0DH,0AH,'$'
BINNUM DB 10 DUP(?)
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
MAIN PROC FAR
START: PUSH DS
SUB AX,AX
PUSH AX
MOV AX,DATA
MOV DS,AX
CALL INPUTNUM
CALL CRLF
CALL DECIBIN
CALL SORTNUM
RET
MAIN ENDP
INPUTNUM PROC NEAR
MOV DX,OFFSET INPUT
MOV AH,09H
INT 21H ;显示 please input 10 numbers:
MOV DX,OFFSET BUFFER
MOV AH,0AH
INT 21H ;以字符的形式输入10个数字(0——99)
RET
INPUTNUM ENDP
CRLF PROC NEAR
MOV DL,0DH
MOV AH,02H
INT 21H
MOV DL,0AH
MOV AH,02H
INT 21H
RET
CRLF ENDP
DECIBIN PROC NEAR ;ASC2码转成二进制
LEA SI,CHARS
MOV DX,0
MOV CX,29
LEA DI,BINNUM
LOOP1: PUSH CX
MOV BL,[SI]
SUB BL,30H
JL MOVNUM
CMP BL,09H
JG MOVNUM
MOV AX,BX
PUSH AX
MOV AX,DX
MOV CX,10
MUL CX
MOV DX,AX
POP AX
ADD DX,AX
POP CX
JCXZ NEXT1
INC SI
LOOP LOOP1
MOVNUM: PUSH BX
MOV BX,DX
MOV [DI],BX
POP BX
INC SI
INC DI
XOR DX,DX
JCXZ NEXT1
LOOP LOOP1
NEXT1: RET
DECIBIN ENDP
SORTNUM PROC NEAR ;排序
MOV CX,10
LOOP2: MOV DI,CX
MOV BX,0
LOOP3: MOV AL,BINNUM[BX]
CMP AL,BINNUM[BX+1]
JGE CONTINUE
XCHG AL,BINNUM[BX+1]
MOV BINNUM[BX],AL
CONTINUE: INC BX
LOOP LOOP3
MOV CX,DI
LOOP LOOP2
RET
SORTNUM ENDP
CODE ENDS
END START