-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLAB5b.asm
87 lines (79 loc) · 973 Bytes
/
LAB5b.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.MODEL small
.STACK 100h
.DATA
messl DB 10, 13, 'Today is $' ; 1041, 13=CR
.CODE
Today PROC
MOV AX, @data
MOV DS, AX
MOV DX, OFFSET messl
MOV AH, 09h
INT 21H
MOV AH,2AH
INT 21H
PUSH CX
MOV CX,0
MOV CL, DL
PUSH CX
MOV CL,DH
PUSH CX
MOV DH, 0
;DISPLAY MONTH
MOV DX, 0
POP AX
MOV CX,0
MOV BX,10
DIVIDEM:DIV BX
PUSH DX
ADD CX,1
MOV DX, 0
CMP AX, 0
JNE DIVIDEM
DIVDISPM:POP DX
ADD DL,30h
MOV AH, 02h
INT 21H
LOOP DIVDISPM
MOV DL,'/'
MOV AH,02h
INT 21H
;DISPLAY DAY
MOV DX, 0
POP AX
MOV CX,0
MOV BX,10
DIVIDED:DIV BX
PUSH DX
ADD CX,1
MOV DX,0
CMP AX,0
JNE DIVIDED
DIVDISPD:POP DX
ADD DL,30H
MOV AH,02H
INT 21H
LOOP DIVDISPD
MOV DL,'/'
MOV AH,02H
INT 21H
;DISPLAY YEAR
MOV DX,0
POP AX
MOV CX,0
MOV BX,10
DIVIDEY:DIV BX
PUSH DX
ADD CX,1
MOV DX,0
CMP AX,0
JNE DIVIDEY
DIVDISPY:POP DX
ADD DL,30H
MOV AH,02H
INT 21H
LOOP DIVDISPY
MOV AL,0
MOV AH,4CH
INT 21H
TODAY ENDP
END TODAY