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 page 55,132
43 .xlist
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 include dos.mac
81 include ws.mac
82 include ws_stack.mac
83 include ws_dcls.mac
84 include ws_error.mac
85 include wsmincap.mac
86
87 page
88
89
90
91 dseg
92
93
94
95 public user_interrupt_handler
96
97
98
99 endds
100
101 page
102
103
104
105
106 PGROUP GROUP PROG
107 PROG SEGMENT WORD PUBLIC 'PROG'
108 ASSUME CS:PGROUP
109
110
111
112 extrn packetize_flag:word
113 extrn bgcount:word
114 extrn IN_SOFT:word
115 extrn setup_stack:near
116 extrn reset_stack:near
117 extrn send_terminal_data:near
118 extrn terminal_buffer_check:near
119 extrn snddat:near
120 extrn i_execom:near
121 extrn i_creins:near
122 extrn i_desins:near
123 extrn i_fndcnu:near
124 extrn i_fndcna:near
125 extrn i_execap:near
126 extrn i_getbgm:near
127 extrn i_putbgm:near
128 extrn i_sendbg:near
129 extrn i_reset:near
130 extrn i_sleep:near
131 extrn i_suspnd:near
132 extrn i_connect:near
133 extrn terminate_mowse:near
134 extrn toggle_debug_switches:near
135 extrn snddis:near
136 extrn sndbrk:near
137 extrn line_break:near
138
139
140
141 public uisystem
142
143 user_interrupt_handler proc near
144
145 jmp arounds
146
147 even
148 uisystem db 0
149 db 'MOWSE',0
150
151
152
153 arounds:
154 inc CS:IN_SOFT
155 call setup_stack
156 push bp
157
158
159
160 or cx,cx
161 jbe nocopy
162 push ds
163 pop es
164 mov si,sireg[bp]
165 lea di,wsparm[bp]
166 mov ds,dsreg[bp]
167 rep movsb
168 push es
169 pop ds
170
171
172
173 nocopy:
174 xor cx,cx
175 mov cl,ah
176 sal cx,1
177 mov di,cx
178 cmp di,MAXJMP
179 jbe do_jump
180 jmp end_int
181
182 do_jump:
183 mov cx,CS:JMPTBL[di]
184 jmp cx
185
186
187
188 SENDMESS:
189 jmp end_int
190
191
192
193 SENDTERM:
194 jmp end_int
195
196
197
198 EXECUTCOM:
199 push bp
200 lea di,wsparm[bp]
201 mov bp,sp
202 push di
203 call i_execom
204 mov sp,bp
205 pop bp
206 jmp copy_back
207
208
209
210 EXECAP:
211 push bp
212 lea di,wsparm[bp]
213 mov cx,cxreg[bp]
214 mov bp,sp
215 push cx
216 push di
217 call i_execap
218 mov sp,bp
219 pop bp
220 jmp copy_back
221
222
223
224 CREATE_INST:
225 push bp
226 lea di,wsparm[bp]
227 mov ax,bp
228 mov bp,sp
229 push di
230 push ax
231 call i_creins
232 mov sp,bp
233 pop bp
234 jmp copy_back
235
236
237
238 DESTROY_INST:
239 push bp
240 lea di,wsparm[bp]
241 mov bp,sp
242 push di
243 call i_desins
244 mov sp,bp
245 pop bp
246 jmp copy_back
247
248
249
250 FINDCAPNAME:
251 push bp
252 lea di,wsparm[bp]
253 mov bp,sp
254 push di
255 call i_fndcna
256 mov sp,bp
257 pop bp
258 jmp copy_back
259
260
261
262 FINDCAPNUM:
263 push bp
264 lea di,wsparm[bp]
265 mov bp,sp
266 push di
267 call i_fndcnu
268 mov sp,bp
269 pop bp
270 jmp copy_back
271
272
273
274 L08:
275 mov ax,wsparm[bp]
276 push bp
277 push ax
278 call toggle_debug_switches
279 pop bp
280 jmp copy_back
281
282
283
284 GETTDATA:
285 lea bx,wsparm[bp]
286 mov cx,bgcount
287 mov gbpflag[bx],cx
288
289 mov di,getlbp[bx]
290 mov cx,getlbs[bx]
291 push es
292 mov es,dsreg[bp]
293 push bp
294 call terminal_buffer_check
295 pop bp
296 pop es
297
298 cmp cx,0
299 jne data_ready
300
301 test packetize_flag,1
302 jne set_attached
303 mov ax,MOWSE_DETACHED
304 jmp data_ready
305
306 set_attached:
307 mov ax,MOWSE_ATTACHED
308
309 data_ready:
310 mov gmincap[bx],ax
311 mov ax,cx
312 mov cx,gettlen
313 jmp copy_back
314
315
316
317 PUTDATA:
318 lea bx,wsparm[bp]
319 test packetize_flag,1
320 jz nopkt
321
322
323
324 mov ax,minor_cap[bx]
325 lea si,pkthdr[bp]
326 mov [si],al
327 mov datap[bp],si
328 mov datal[bp],1
329 lea si,puttstr[bx]
330 mov datap+2[bp],si
331 mov ax,putstrl[bx]
332 mov datal+2[bp],ax
333 mov datac[bp],2
334 mov chan[bp],FG
335 lea bx,chan[bp]
336
337
338
339 jmp send_pkt
340
341
342
343 nopkt:
344 push bp
345 mov cx,putstrl[bx]
346 lea si,puttstr[bx]
347 mov bp,sp
348 call send_terminal_data
349 mov sp,bp
350 pop bp
351 jmp end_int
352
353
354
355 GETBGMES:
356 push bp
357 lea di,wsparm[bp]
358 mov bp,sp
359 push di
360 call i_getbgm
361 mov sp,bp
362 pop bp
363 jmp copy_back
364
365
366
367 PUTBGMES:
368 push bp
369 lea di,wsparm[bp]
370 mov bp,sp
371 push di
372 call i_putbgm
373 mov sp,bp
374 pop bp
375 jmp copy_back
376
377
378
379 SENDBG:
380 push bp
381 lea di,wsparm[bp]
382 mov cx,cxreg[bp]
383 mov bp,sp
384 push cx
385 push di
386 call i_sendbg
387 mov sp,bp
388 pop bp
389 jmp copy_back
390
391
392
393 L14:
394 mov bx,wsparm[bp]
395 mov ax,[bx]
396 jmp end_int
397
398
399
400 RESET:
401 push bp
402 lea di,wsparm[bp]
403 mov cx,cxreg[bp]
404 mov bp,sp
405 push cx
406 push di
407 call i_reset
408 mov sp,bp
409 pop bp
410 jmp copy_back
411
412
413
414 SLEEP:
415 push bp
416 lea di,wsparm[bp]
417 mov bp,sp
418 push di
419 call i_sleep
420 mov sp,bp
421 pop bp
422 jmp copy_back
423
424 SUSPEND:
425 push bp
426 lea di,wsparm[bp]
427 mov bp,sp
428 push di
429 call i_suspnd
430 mov sp,bp
431 pop bp
432 jmp copy_back
433
434 CONNECT:
435 push bp
436 lea di,wsparm[bp]
437 mov bp,sp
438 push di
439 call i_connect
440 mov sp,bp
441 pop bp
442 jmp copy_back
443
444
445
446 DISCONNECT:
447 test wsparm[bp],1
448 jne discon_ok
449
450 test packetize_flag,1
451 je discon_ok
452
453 push bp
454 mov bp,sp
455 call snddis
456 mov sp,bp
457 pop bp
458 jmp copy_back
459
460 discon_ok:
461 push bp
462 mov bp,sp
463 call terminate_mowse
464 mov sp,bp
465 pop bp
466 jmp copy_back
467
468
469
470 FOREBREAK:
471 xor ax,ax
472 test packetize_flag,1
473 jne soft_brk
474 call line_break
475 jmp copy_back
476
477 soft_brk:
478 push bp
479 mov bp,sp
480 call sndbrk
481 mov sp,bp
482 pop bp
483 jmp copy_back
484
485
486
487
488 send_pkt:
489 push bp
490 lea si,datap[bp]
491 lea di,datal[bp]
492 mov ax,chan[bp]
493 mov cx,datac[bp]
494 mov bp,sp
495 push di
496 push si
497 push cx
498 push ax
499 call snddat
500 mov sp,bp
501 pop bp
502 cmp ax,1
503 je send_pkt
504 mov axreg[bp],ax
505 jmp end_int
506
507
508
509
510
511 copy_back:
512 mov axreg[bp],ax
513 mov cx,cxreg[bp]
514 or cx,cx
515 jbe end_int
516 mov di,sireg[bp]
517 lea si,wsparm[bp]
518 mov es,dsreg[bp]
519 rep movsb
520
521
522
523 end_int:
524 pop bp
525 call reset_stack
526 dec CS:IN_SOFT
527 iret
528
529
530
531 JMPTBL dw pgroup:SENDMESS
532 dw pgroup:SENDTERM
533 dw pgroup:EXECUTCOM
534 dw pgroup:EXECAP
535 dw pgroup:CREATE_INST
536 dw pgroup:DESTROY_INST
537 dw pgroup:FINDCAPNAME
538 dw pgroup:FINDCAPNUM
539 dw pgroup:L08
540 dw pgroup:GETTDATA
541 dw pgroup:PUTDATA
542 dw pgroup:GETBGMES
543 dw pgroup:PUTBGMES
544 dw pgroup:SENDBG
545 dw pgroup:L14
546 dw pgroup:RESET
547 dw pgroup:SLEEP
548 dw pgroup:DISCONNECT
549 dw pgroup:FOREBREAK
550 dw pgroup:SUSPEND
551 dw pgroup:CONNECT
552 JMP_END dw 0
553 MAXJMP = JMP_END - JMPTBL
554
555
556 user_interrupt_handler endp
557
558 endps
559 end
560