-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA20.asm
More file actions
133 lines (99 loc) · 2.41 KB
/
Copy pathA20.asm
File metadata and controls
133 lines (99 loc) · 2.41 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
.model small
.586
public display_a20
extrn first_screen:far,QUIT:far,clear_screen:far,ib_free:far
.data
kbc_satte_present db 'kbc present now ','$'
kbc_satte_not_present db 'kbc not present now ','$'
msg_enable_fast_ga20 db 'enable a20 ','$'
msg_disable_fast_ga20 db 'disable a20 ','$'
msg_port db'1.enable a20 2.disable a20','$'
msg_kbc db'3.enable a20 4.disable a20(keyboarf controler)','$'
msg_enable_fast_kbc db 'enable a20 by keboard ','$'
msg_disable_fast_kbc db 'disable a20 by keboard ','$'
MESG_RETURN DB 'Return menu: ESC Rewrite: Tab and Backspace ','$'
.code
display_a20:
include MACRO_zifu.MAC
call clear_screen
mov BH,0
MOV DH,1 ;放入行号
MOV DL,3 ;放入列号
mov AH,02h
INT 10H;
msg msg_port
mov bh,0
mov dh,23 ;放入行号
mov dl,1 ;放入列号
mov ah,02h
int 10h;
msg MESG_RETURN
NO_INPUT_key:
push ax
push bx
push dx
mov BH,0
MOV DH,3 ;放入行号
MOV DL,3 ;放入列号
mov AH,02h ;display start point
INT 10H;
pop dx
pop bx
pop ax
MOV AH,11H
INT 16H ;检测按键是有否按下,有则判断按键是否是ESC,否则继续刷新
jz NO_INPUT_key
mov ah,0
int 16h
cmp ah,01h ;若为Q 键则退到主界面
jz first_screen
; cmp al,'1'
; jz enable_fast_ga20
cmp al,'1'
jz enable_addr_bit_20
cmp al,'2'
jz disable_addr_bit_20
jmp NO_INPUT_key
enable_addr_bit_20:
mov ah, 0DFh ; Data for output port to enable A20.
ed_00:
mov al, 0D1h
out 64h, al
ed_01:
jcxz $+2
in al, 64h
cmp al, 0FFh
je kbc_not_present
call ib_free
mov al, ah
out 60h, al
msg msg_enable_fast_kbc
JMP NO_INPUT_key
kbc_not_present:
mov al, 02h
out 92h, al
cmp sp, sp ; ZF - Indicates Gate-A20 enabled.
msg msg_enable_fast_ga20
jmp NO_INPUT_key
disable_addr_bit_20 :
mov ah, 0DDh ; Data for output port to disable A20.
ed_2:
mov al, 0D1h
out 64h, al
ed_21:
jcxz $+2
in al, 64h
cmp al, 0FFh
jz kbc_not_present1
call ib_free
mov al,ah
out 60h,al
msg msg_disable_fast_kbc
jmp NO_INPUT_key
kbc_not_present1:
mov al, 00h
out 92h, al
cmp sp, sp ; ZF - Indicates Gate-A20 disabled.
msg msg_disable_fast_ga20
JMP NO_INPUT_key
END