要求输入年月日,并输出.若输入错误则提示错误信息
下面是我编的程序,但是调试不出来,望高手帮我看看,谢谢了
DATAS SEGMENT
DATA1 DB 'INPUTERORR','$';此处输入数据段代码
DATA2 DB 'YOU INPUT THE DATE IS ',13,10
DATA3 DB 4 DUP(?),'-'
DATA4 DB 2 DUP(?),'-'
DATA5 DB 2 DUP(?),'$'
A1 DB 'please input the year:',13,10,'$'
B1 db 'please input the month:',13,10,'$'
C1 db 'please input the data:',13,10,'$'
DATAS ENDS
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
CODES SEGMENT
ASSUME CS:CODES,DS:DATAS,SS:STACKS
START:
MOV AX,DATAS
MOV DS,AX
MOV CX,0FFFH
XL:MOV DL,7
MOV AH,2
INT 21H
LOOP XL
LEA SI,DATA3
LEA DX,A1
MOV AH,9
INT 21H
Y: MOV CX,4
MOV AH,1
INT 21H
MOV [SI],AL
INC SI
LOOP Y
LEA DX,B1
MOV AH,9
INT 21H
LEA SI,DATA4
MOV CX,2
M: MOV AH,1
INT 21H
MOV [SI],AL
INC SI
LOOP M
LEA SI,DATA4
MOV AL,[SI]
CMP AL,'0'
JZ M1
CMP AL,'1'
JZ M2
JMP MISS
M1:INC SI
MOV AL,[SI]
CMP AL,'1'
JZ D1
CMP AL,'2'
JZ D3
CMP AL,'3'
JZ D1
CMP AL,'4'
JZ D2
CMP AL,'5'
JZ D1
CMP AL,'6'
JZ D2
CMP AL,'7'
JZ D1
CMP AL,'8'
JZ D1
CMP AL,'9'
JZ D2
JMP MISS
M2:INC SI
MOV AL,[SI]
CMP AL,'0'
JZ D1
CMP AL,'1'
JZ D2
CMP AL,'2'
JZ D1
JMP MISS
D1: LEA DX,C1
MOV AH,9
INT 21H
LEA SI,DATA5
MOV CX,2
DN:MOV AL,1
INT 21H
MOV [SI],AL
INC SI
LOOP DN
LEA SI,DATA5
MOV AL,[SI]
CMP AL,'0'
JZ Q1
CMP AL,'1'
JZ Q2
CMP AL,'2'
JZ Q2
CMP AL,'3'
JZ Q3
JMP MISS
D2:LEA DX,C1
MOV AH,9
INT 21H
LEA SI,DATA5
MOV CX,2
DN1:MOV AL,1
INT 21H
MOV [SI],AL
INC SI
LOOP DN1
LEA SI,DATA5
MOV AL,[SI]
CMP AL,'0'
JZ Q1
CMP AL,'1'
JZ Q2
CMP AL,'2'
JZ Q2
CMP AL,'3'
JZ Q4
JMP MISS
D3:LEA DX,C1
MOV AH,9
INT 21H
LEA SI,DATA5
MOV CX,2
DN2:MOV AL,1
INT 21H
MOV [SI],AL
INC SI
LOOP DN2
LEA SI,DATA5
MOV AL,[SI]
CMP AL,'0'
JZ Q1
CMP AL,'1'
JZ Q2
CMP AL,'2'
JZ Q5
JMP MISS
Q1:INC SI
MOV AL,[SI]
CMP AL,'1'
JB MISS
CMP AL,'9'
JA MISS
JMP WANC
Q2:INC SI
MOV AL,[SI]
CMP AL,'0'
JB MISS
CMP AL,'9'
JA MISS
JMP WANC
Q3:INC SI
MOV AL,[SI]
CMP AL,'0'
JB MISS
CMP AL,'1'
JA MISS
JMP WANC
Q4:INC SI
MOV AL,[SI]
CMP AL,'0'
JNZ MISS
JMP WANC
Q5:INC SI
MOV AL,[SI]
CMP AL,'0'
JB MISS
CMP AL,'8'
JA MISS
JMP WANC
WANC:LEA DX,DATA2
MOV AH,9
INT 21H
JMP JSH
MISS:LEA DX,DATA1
MOV AH,9
INT 21H
JMP XL
JSH:MOV AH,4CH
INT 21H
CODES ENDS
END START