-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathASYVEC.ASM
198 lines (163 loc) · 4.24 KB
/
ASYVEC.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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
; ASY (8250/16450/16550A "comm" port) interrupt hooks
; Copyright 1991 Phil Karn, KA9Q
;% .MODEL MEMMOD,C
include asmgloba.h
%MACS
extrn doretch:proc,asyint:far,eoi:proc
.DATA
extrn Sssave:word
extrn Spsave:word
extrn Stktop
.CODE
dbase dw @Data
; asy0vec - asynch channel 0 interrupt handler
public asy0vec
label asy0vec far
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
; push ax ; save user regs on interrupt stack
; push bx
; push cx
; push dx
; push bp
; push si
; push di
PUSHALL
push es
call eoi
mov ax,0 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doretch
; asy1vec - asynch channel 1 interrupt handler
public asy1vec
label asy1vec far
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
; push ax ; save user regs on interrupt stack
; push bx
; push cx
; push dx
; push bp
; push si
; push di
PUSHALL
push es
call eoi
mov ax,1 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doretch
; asy2vec - asynch channel 2 interrupt handler
public asy2vec
label asy2vec far
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
; push ax ; save user regs on interrupt stack
; push bx
; push cx
; push dx
; push bp
; push si
; push di
PUSHALL
push es
call eoi
mov ax,2 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doretch
; asy3vec - asynch channel 3 interrupt handler
public asy3vec
label asy3vec far
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
; push ax ; save user regs on interrupt stack
; push bx
; push cx
; push dx
; push bp
; push si
; push di
PUSHALL
push es
call eoi
mov ax,3 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doretch
; asy4vec - asynch channel 4 interrupt handler
public asy4vec
label asy4vec far
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
; push ax ; save user regs on interrupt stack
; push bx
; push cx
; push dx
; push bp
; push si
; push di
PUSHALL
push es
call eoi
mov ax,4 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doretch
; asy5vec - asynch channel 5 interrupt handler
public asy5vec
label asy5vec far
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
; push ax ; save user regs on interrupt stack
; push bx
; push cx
; push dx
; push bp
; push si
; push di
PUSHALL
push es
call eoi
mov ax,5 ; arg for service routine
push ax
call asyint
inc sp
inc sp
jmp doretch
end