-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathkeyboard_hardware.asm
More file actions
executable file
·71 lines (61 loc) · 1.3 KB
/
keyboard_hardware.asm
File metadata and controls
executable file
·71 lines (61 loc) · 1.3 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
assume cs:code,ds:data;
data segment
PA EQU 44a0h ;20a0h
PB EQU 44a1h ;20a1h
PC EQU 44a2h ;20a2h
CR EQU 44a3h ;20a3h
rowVal db ?
colVal db ?
sCode db ?
data end
code segment
START: MOV ax,data
MOV ds,ax
MOV al,90h ;for A i/p and B,C o/p
MOV dx,CR
OUT dx,al
AGN: MOV bl,01h
MOV bh,3h
MOV ah,01
MOV cl,00h
NXTROW: MOV dx,PC
MOV al,bl
OUT dx,al
MOV dx,PA
IN al,dx
CMP al,00h
JNE CAL
ADD cl,08h
INC ah
SHL bl,01h
DEC bh
JNZ NXTROW
JMP AGN
CAL: MOV rowVal,ah
MOV ah,00h
ROTA: ROR al,01
JC NXT
INC ah
INC cl
JMP ROTA
NXT: MOV sCode,cl
MOV colVal,ah
MOV al,cl
CALL DISP
MOV ah,4ch
INT 21h
DISP PROC
AAM
ADD ax,3030h
MOV dl,ah
MOV ah,2
PUSH ax
INT 21h
POP ax
MOV dl,al
MOV ah,2
INT 21h
RET
DISP ENDP
CODE ends
end START