-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathKEYBOARD.INC
57 lines (50 loc) · 969 Bytes
/
KEYBOARD.INC
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
KEYVECT equ 9
; 一回しかコールしない物は マクロにする
; キーボード処理開始
KEYINT_INIT macro
cli
xor ax, ax
mov es, ax
mov ax, offset keyint_proc
xchg ax, es:[KEYVECT*4+0]
mov ds:[int09off], ax
mov ax, cs
xchg ax, es:[KEYVECT*4+2]
mov ds:[int09seg], ax
ifndef DEBUG
in al, 02h
mov ds:[IMR0], al
in al, 0ah
mov ds:[IMR1], al
mov al, 0fdh
out 02h, al
mov al, 0ffh
out 0ah, al
mov al, 0
mov cx, 11h
mov di, MEM_KB_KY_STS
rep stosb
mov al, 3ah
out 43h, al
mov cx, 20
loop $
mov al, 32h
out 43h, al
endif
sti
endm
; キーボード終了 / CLIでコールされる筈
KEYINT_TERM macro
xor ax, ax
mov es, ax
mov ax, ds:[int09off]
mov es:[KEYVECT*4+0], ax
mov ax, ds:[int09seg]
mov es:[KEYVECT*4+2], ax
ifndef DEBUG
mov al, ds:[IMR0]
out 02h, al
mov al, ds:[IMR1]
out 0ah, al
endif
endm