DATAS SEGMENT
DATA1 db 'inputerorr','$'
DATA2 DB 16 dup(?),'$'
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
LEA DI,DATA2
MOV CX,4
MOV BL,00H
L1:MOV AH,01
INT 21H
CMP AL,30H
JA L2
JMP L
L2:CMP AL,39H
JNA L4
CMP AL,41H
JA L3
JMP L
L3:CMP AL,46
JNA2 L5
L:LEA DX,DATA1
MOV AH,9
INT 21H
L4:SUB AL,30H
JMP L6
L5:SUB AL,37H
L6:PUSH CX
MOV CL,4
SHL AL,CL
MOV CX,4
SHL AL,1
ADC BL,30H
MOV [DI],BL
INC DI
LOOP L6
POP CX
LOOP L1
LEA DX,DATA2
MOV AH,9
INT 21H
MOV AH,4CH
INT 21H
CODES ENDS
END START
程序执行后一输入字符,DOS界面就退出了,路过次地的高手帮小弟一把,谢谢了