.MODEL SMALL
.STACK 64
.DATA
EN_DATE DB 'ENTER DATE (dd-mm-yyyy): $'
MSGDAY DB 'DAY : $'
MSGMONTH DB 'MONTH : $'
NL DB 0DH,0AH,'$'
DAY DB ' ','$'
MONTH DB ' ','$'
.CODE
MAIN PROC
MOV AX,@DATA
MOV DS,AX
LEA DX,EN_DATE
MOV AH,09H
INT 21H
LEA SI,DAY
READ_DAY:
MOV AH,01H
INT 21H
CMP AL,2DH
JE F_READ_DAY
MOV [SI],AL
INC SI
JMP READ_DAY
F_READ_DAY:
INC SI
MOV AL,'$'
MOV [SI],AL
LEA SI,MONTH
READ_MONTH:
MOV AH,01H
INT 21H
CMP AL,2DH
JE F_READ_MONTH
MOV [SI],AL
INC SI
JMP READ_MONTH
F_READ_MONTH:
INC SI
MOV AL,'$'
MOV [SI],AL
MOV CL,04H
READ_YEAR:
MOV AH,01H
INT 21H
LOOP READ_YEAR
DISP:
LEA DX,NL
MOV AH,09H
INT 21H
LEA DX,MSGDAY
INT 21H
LEA DX,NL
INT 21H
LEA DX,DAY
INT 21H
LEA DX,NL
INT 21H
LEA DX,MSGMONTH
INT 21H
LEA DX,NL
INT 21H
LEA DX,MONTH
INT 21H
MOV AH,4CH
INT 21H
MAIN ENDP
END MAIN
OUTPUT
************
C:\tasm>ex04
ENTER DATE (dd-mm-yyyy): 17-12-2005
DAY :
17
MONTH :
12