-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc19-5.asm
89 lines (67 loc) · 1.14 KB
/
c19-5.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
88
assume cs:code,ss:stack,ds:data
data segment
db 128 dup(0)
data ends
stack segment
db 128 dup(0)
stack ends
code segment
start:
mov ax,stack
mov ss,ax
mov sp,128
call clean_screen
call init_reg
time:
mov al,9; 读取年
mov di,160*10 + 25*2
call show
mov al,8; 读取月
mov di,160*10 + 28*2
call show
mov al,7; 读取日
mov di,160*10 + 31*2
call show
mov al,4; 读取时
mov di,160*10 + 34*2
call show
mov al,2; 读取分
mov di,160*10 + 37*2
call show
mov al,0; 读取秒
mov di,160*10 + 40*2
call show
jmp time
mov ax,4c00h
int 21h
;================================
clean_screen:
mov bx,0B800H;
mov es,bx
mov bx,0
mov dx,0700H ;空字符串
mov cx,2000
clearScreen: mov es:[bx],dx
add bx,2
loop clearScreen
ret
;=================================
init_reg:
mov bx,0b800h
mov es,bx
ret
;=================================
show:
out 70h,al
in al,71h
mov ah,al
mov cl,4
shr ah,cl
and al,00001111b
add ah,30h
add al,30h
mov es:[di],ah
mov es:[di+2],al
ret
code ends
end start