RS-232 Mouse Driver
468
469
01CF
53
PUSH
8X
Save frame counter.
470
0100
52
PUSH
OX
Save
471
0101
32 EO
XOR
AH,Al
AH now holds mask of buttons
that
hive chlnged.
472
0103
B7 01
MeV
BH. 01H
Mask
fo r
fir s t
bu t ton.
473
0105
B9 0003
MOV
CX.3
Number of buttons
to proc •••.
474
475
0108
MBUTTON:
476
0108
8A DC
MOV
Bl.AH
:~:~ ~fc~~Ie~:e~h~~?~o~a~~1
,...
477
OlDA
22 OF
AND
Bl. BH
the on. that
chlnged.
478
01DC
74 41
JZ
MNEXT BUTTON
;Skip on
if
no t .
479
OlOE
84 F8
TEST
BH,Al
;Determine • t . t e
(make or br.ak) of .elected butt
480
OlEO
74 04
J1
MBUl TON_OC",./N
481
482
01E2
MBUTlON UP:
483
484
01E2
B3 80
MOV
Bl,80H
; Set bit
7
(make/break bit)
to 0 (break).
485
OlE4
EB 02
JMP
SHORT MBUTTON 1SFt
48S
487
DIES
MBUTTON DOWN
488
489
OlE6
B3 00
MeV
BL. OOH
; Set bit
7
(make/break bit
1
to 1 (make) .
490
491
DIE a
MBU"rrON
ISR
492
OlEa
53
PUSH
BX
493
01E9
~B
09
MeV
BX
I
CX
494
OlES
32 FF
XOR
BH,
BH
495
OlEO
FE
CB
OEC
BL
496
OlEF
2E:
8A SF 01F7 R
MeV
CL, CS : BUTTON_ TAB [BX
J
497
01F 4
5B
POP
BX
498
01F5
EB 03
JMP
SHORT BISR2
499
01F7
00
BUTTON TAB
DB
0
Ie f
t
button
500
01 F 8
02
OB
2
middle button
501
01F9
01
DB
1
right
button
502
OlFA
BISR2 :
503
OlFA
OA 09
OR
Bl, CL
504
01FC
32 FF
XOR
BH,
BH
;
cle~r
out
bh
505
50S
01FE
50
PUSH
AX
; Save
regilterl.
507
01FF
53
PUSH
BX
508
0200
51
PUSH
CX
~09
0201
lE
PUSH
OS
510
511
~~~eEvent
512
;C re.t e
Record
513
514
0202
B5 09
MOV
oH,T KC BUTTON
; Se t
dat a type
51!>
0204
2E
8A 16 0151 R
MeV
Dl, peUO-VEcr NUM
,Get
vee tor
number of moule "
PGIO.
516
0209
B9 0000
MeV
CX,O
-
-
; Bu rs t
~s~~t~o(~~~~er
517
020C
8C C8
MeV
AX .CS
; Po i nt
header.
518
020E
40
INC
AX
S 19
020F
40
INC
AX
520
0210
SE CO
MeV
ES ,AX
521
0212
84 00
MeV
AH,F ISR
; Set
1SR function.
522
0214
Bo 002A
MeV
BP, V:=SINPUT
;We're calling the INPUT driver
523
0217
FA
CLI
;Turn off
interrupt. while wI're ou t .
524
0218
CO 6F
INT
HP _ENTRY
525
021A
FB
STI
;Re-enable interrupti.
526
527
021B
IF
POP
OS
528
021C
59
POP
CX
529
0210
5B
POP
8X
530
021E
58
POP
AX
531
532
021F
MNEXT
-
BUTTON:
533
534
021F
DO [7
SHL
BH,l
;Move button .ellctor mlsk to nel( t
button.
535
0221
E2 B5
LOOP
MBUTTON
536
0223
SA
POP
OX
; Re s tore
537
0224
58
POP
BX
;Get
frame counter back.
538
539
; CHECK FOR MOTION
540
541
0225
43
MSI_3 :
INC
BX
; Poi nt
to f 1 r. t
delta X in buffer.
542
0226
2E.
8A 97 013C
MOV
OL, TEMP _BUFFER [BX]
543
022B
43
INC
BX
;Glt
f i fit
delt a Y.
544
022C
2E.
8A B7 013C
MOV
DH, TEMP _BUFFER [8X
1
545
0231
43
INC
BX
;Add second deU
I
to f 1 r. t .
546
0232
2E:
02
97
013C
ADD
Dl,TEMP BUFFER[BXl
547
0237
43
INC
BX
-
;Add .econd delt a
to f i rtt .
548
0238
2E·
02 B7 013C
ADD
DH, TEMP_BUFFER (BX)
549
550
0230
OB 02
MSI_4 :
OR
~~t~~
;Check for
Ie ro mot
10n.
551
023F
74 IF
JZ
;Skip on i f non. dltected.
552
553
MO~~~~
,.
554
; SEND
ISR EVENT RECORD TO INPUT SYSTEM
555
556
0241
8A C2
MeV
Al,Ol
;Convert delta X to
16 bi t
valu~
and put
557
0243
98
CBW
;it
1n ISR EVI n
t
Record
(BX regia t e r)
558
0244
8B
08
MOV
BX ,AX
559
0246
8A C6
MOV
AL ,oH
;oitto for delta Y (CX
righter).
560
0248
98
caw
561
0249
8B C8
MOV
eX,AX
Driver Writer's Guide
467
Need help?
Do you have a question about the Vectra and is the answer not in the manual?