-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKEY.asm
More file actions
159 lines (127 loc) · 3.59 KB
/
Copy pathKEY.asm
File metadata and controls
159 lines (127 loc) · 3.59 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.MODEL SMALL
.586
extrn recover:far,hide:far,hex:far,DELAY_LONG:FAR,DELAY_SHORT:FAR,
clear_screen:far,first_screen_h:byte,space:far,cheack_input_busy:far,
first_screen:far,back_ground_color:word,rest_system:far
public display_KEY
.data
MESG_KEY DB 'please input your number:','$'
MESG_KEY_LED DB '1.led_display 2.rest system Q.quit system','$'
MESG_RETURN DB 'Return menu: ESC Rewrite: Tab and Backspace ','$'
.code
display_KEY:
include MACRO_zifu.MAC
call clear_screen
mov bh,0
mov dh,0 ;放入行号
mov dl,1 ;放入列号
mov ah,02h
int 10H;
msg MESG_KEY
mov bh,0
mov dh,2 ;放入行号
mov dl,1 ;放入列号
mov ah,02h
int 10H;
msg MESG_KEY_LED
mov bh,0
mov dh,23 ;放入行号
mov dl,1 ;放入列号
mov ah,02h
int 10h;
msg MESG_RETURN
cheack_gain_key:
mov ah,0
int 16h ;读键盘输入一个字符,不回显
cmp al,'1' ;若为1则进入1号功能
jz led_display
cmp al,'2'
JZ rest_system
cmp ah,01h
jZ first_screen
JMP cheack_gain_key ;mov cx,6
led_display:
push ax
push bx
push cx
xor bx,bx
mov bl,1
mov cx,3
led_loop1:
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,bl
out 60h,al
call DELAY_LONG
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
;回复结果
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,0
out 60h,al
shl bl,1 ;回复结果
call DELAY_LONG
loop led_loop1
mov cx,2
led_loop2:
mov bx,3
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
;回复结果
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,bl
out 60h,al
shl bl,1
call DELAY_LONG
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
;回复结果
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,0
out 60h,al
loop led_loop2
mov cx,3
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
;回复结果
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,03h
out 60h,al
mov al,0edh
out 60h,al ;发送设置命令
;回复结果
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,0
out 60h,al
shl bl,1 ;回复结果
call DELAY_LONG
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
mov cx,3
led_loop3: ;回复结果
call cheack_input_busy ;读忙
mov al,0edh
out 60h,al ;发送设置命令
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,07H
out 60h,al ;LIGHT ALL
call DELAY_LONG
call cheack_input_busy
mov al,0edh
out 60h,al ;发送设置命令
;回复结果
call cheack_input_busy ;LED set_byte 0000 _ _ _ 0
mov al,0
out 60h,al
;回复结果
call DELAY_LONG
pop ax
jmp cheack_gain_key
end