-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathasyvec.s
183 lines (144 loc) · 2.99 KB
/
asyvec.s
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
; ASY (8250/16550A "com" port) interrupt hooks
; Copyright 1991 Phil Karn, KA9Q
include asmglobal.h
extrn doret:proc,asyint:far,eoi:proc,fpint:far
.DATA
extrn Sssave:word
extrn Spsave:word
extrn Stktop
.CODE
dbase dw @Data
; asy0vec - asynch channel 0 interrupt handler
public asy0vec
label asy0vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,0 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doret
; asy1vec - asynch channel 1 interrupt handler
public asy1vec
label asy1vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,1 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doret
; asy2vec - asynch channel 2 interrupt handler
public asy2vec
label asy2vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,2 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doret
; asy3vec - asynch channel 3 interrupt handler
public asy3vec
label asy3vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,3 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doret
; asy4vec - asynch channel 4 interrupt handler
public asy4vec
label asy4vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,4 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doret
; asy5vec - asynch channel 5 interrupt handler
public asy5vec
label asy5vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,5 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doret
; fp0vec - Fourport channel 0 interrupt handler
public fp0vec
label fp0vec far
cld
push ds ; save on user stack
mov ds,cs:dbase ; establish interrupt data segment
mov Sssave,ss ; stash user stack context
mov Spsave,sp
mov ss,cs:dbase
lea sp,Stktop
PUSHALL
push es
call eoi
mov ax,0 ; arg for service routine
push ax
call fpint
inc sp
inc sp
jmp doret
end