设置日期(输入格式:2007-07-12):
[CODE]DATA SEGMENT
message1 db 'Please enter the date:','$'
BUF1 DB 11,?
date1 db ?
date2 db ?
date3 db ?
date4 db ?
date5 db ?
date6 db ?
date7 db ?
date8 db ?
date9 db ?
date10 db ?
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
lea dx,message1
mov ah,9
int 21h
MOV DX,OFFSET BUF1
MOV AH,0AH
INT 21H
mov cx,0
MOV Al,date1
sub al,30h
mov bx,1000
mov ah,0
mul bx
add cx,ax
mov al,date2
sub al,30h
mov bl,100
mul bl
add cx,ax
mov al,date3
sub al,30h
mov bl,10
mul bl
add cx,ax
mov al,date4
sub al,30h
mov ah,0
add cx,ax
mov dx,0
mov al,date6
sub al,30h
mul bl
add dh,al
mov al,date7
sub al,30h
add dh,al
mov al,date9
sub al,30h
mul bl
add dl,al
mov al,date10
sub al,30h
add dl,al
mov ah,2bh
int 21h
MOV AH,4CH
INT 21H
CODE ENDS
END START[/CODE]
[此贴子已经被作者于2007-7-12 8:19:14编辑过]