-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTIMERASMT.ASM
56 lines (45 loc) · 1.38 KB
/
TIMERASMT.ASM
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
; Timer interrupt handler
.386
.model flat
.code
public _timer_code_lock_start
public _timer_code_lock_end
public _timer_oldvect
public _timer_count
public _timer_systemcount
public _timer_frequency
public _timer_ds
public _timer_function
public timer_handler_
_timer_code_lock_start:
align 4
_timer_ds dw 0
_timer_oldvect df 0
_timer_count dd 0
_timer_systemcount dw 0
_timer_frequency dw 0
_timer_function dd 0
align 4
timer_handler_: pushad
push DS
push ES
mov DS, CS:_timer_ds
mov ES, CS:_timer_ds
sti
mov AL, 20h
out 20h, AL
inc _timer_count
call _timer_function
mov AX, _timer_frequency
add _timer_systemcount, AX
jc timer_callold
pop ES
pop DS
popad
iretd
timer_callold: pop ES
pop DS
popad
jmp CS:_timer_oldvect
_timer_code_lock_end:
; end