-
Notifications
You must be signed in to change notification settings - Fork 0
/
SPEED.PAS
66 lines (55 loc) · 892 Bytes
/
SPEED.PAS
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
Unit Speed;
Interface
Uses DOS;
Procedure SetKeyboard(Etat:Byte);
Function GetLPT1:Byte; { IRQ7 }
Function GetFloppyDisk:Byte; { IRQ6 }
Function GetKeyBoard:Byte; { IRQ1 }
Function GetClock:Byte; { IRQ0 }
Implementation
Procedure SetKeyboard(Etat:Byte);
Assembler;
ASM IN AL,$21;
AND AL,$FD;
MOV AH,Etat;
NOT AH;
AND AH,1;
SHL AH,1;
ADD AL,AH;
OUT $21,AL;
End;
Function GetLPT1:Byte;
Assembler;
ASM IN AL,$21;
ROL AL,1;
NOT AL;
AND AL,1;
End;
Function GetFloppyDisk:Byte;
Assembler;
ASM IN AL,$21;
ROL AL,1;
ROL AL,1;
NOT AL;
AND AL,1;
End;
Function GetKeyBoard:Byte;
Assembler;
ASM IN AL,$21;
NOT AL;
AND AL,2;
SHR AL,1;
End;
Function GetClock:Byte;
Assembler;
ASM IN AL,$21;
NOT AL;
AND AL,1;
End;
Procedure DivisionZero;
Interrupt;
Begin
End;
BEGIN
SetIntVec($00,@DivisionZero);
END.