RS-232 Mouse Driver
; PRINT SIGN-ON MESSAGE
MeV
OX,OFFSET SIGN ON MSG
MOV
AH, PRINT STR
-
-
I NT
OOS_E NTRV
; PARSE CONF 10. SYS COMMAND LINE TO DETERMINE WHICH COM PORT THE MOUSE IS ON
;Slt baud rate div1l0r to 1200 baud.
: INITIALIZE SERIAL PORT PARAMETERS
;Clear existing error or character.
;Point
to linl control
reg1ltlr.
;S,t
linl control
regi.tlr to d1vi.or programming
;mode.
:~~t~{'to
divi.or LSB registtr
(ba.e).
;lSB for 1200 bp •.
~~~t~r'to
MSB of d1vi.or (ba'l + 1).
;MS8 for 1200 bpi.
;Oelay.
.
I f we
IN
1 n d up hi r e,
the r I
WI
r
I
no par am. t • r.
~g~c~~~rdw~~ :~:c~~T':~~d ~~~'C~rp~~t ic~t1d
default.
;Convlrt off let
into ASCIr COM number
(1 - 4).
::O~~~at~1}~~elC~~~~0~1{~g~~t:~rl~;~t
+3).
;Ollay.
;Move COM port
table offset
into OI.
;Segment
address of COM port base address table.
;Oet ball addre.s of COM port out of tabl •.
;Makl lure port Ix1.t •.
;Continul with initia11zat10n
if
1t do •• ,
;otherw1'I,
go to Irror rout1ne.
;Point
to modtm cont rol
reghter
(ba.e
+
4)
;DTR and RTS . t t , OUT2 . t t to enablt interrupt •.
;Clear BX.
It will be ulld as index 1nto
: command linl.
;Load ES:OI with pointer to CONFIG.SYS co",",and
; 1
i
ne .
;Oet
next character in command 11ne.
:Check for backslash.
,If
f
0
u nd.
1 n d i cat e 1St art 0 f
par ame t
I
r
I .
;Check for carriage
return.
(Indicatel a bogal
; Sit
0
f
par ami t • r
S ) .
~t~e~~u~~r il~~ ;~:~~1(~nd~~~~~ ~~n~iram.ters
;entered in command 11ne.
;If
found,
atop scanning command l1ne.
;E1sl, p01nt
to next character,
;and continul scanning command linl.
; 0
I
t
n
I
x t
c h a r act
e
r .
Sh
0
u
I d
1 n d i cat I
COM po r t
: to
USI.
Valid
range is
1 -
4
; Con " ' r t
numb
e
r
1
n too f f set
fro mI.
:Plrform range check on
results.
:
~
1
~
;
~
1:
n
1
~ ~ ~ ~
;
~ ~
t
~.~ ~
i
Y: .
m
0
u
I '
1
n
t •
r r
up
t
;11
bling . I t up.
;Convlrt
into offslt
1nto STD-8IOS
COM
port
;base addresl
tabll at 0040:0000H.
;Save i t
for
future use.
OX,S
~~6~~
$+2
oI,AX
AX ,40H
ES ,AX
OX,ES:[OI]
OX ,OX
IC 4A
IN!T _NO_PORT
AL ,BYTE PTR ES: (01 +BX]
Al, ' / '
IC
2
Al-:-CR
IC
3
Al-:-LF
IC
3
BX-
IC_l
BX
Al ,BYTE PTR ES: (01 +BX]
Al,
'1'
IC
3
AL
~3
IC_3
OX ,2
AL,03H
~~6~~
$+2
BX, AX
BX
,1
BL, '
I'
COM_MSG, BL
BX,O
01, ES: (01] . RH_CK>_LINE
OX,2
AL,80H
~~6~~
$+2
oX,3
AL, BOH
~~6:~
$+2
OX
AL,OOH
OX,AL
SHORT $+2
OX
AL,OBH
AX
,I
COM NUMBER, AX
SHOR'T IC_4
COM_NUMBER ,0
ADD
IN
JMP
MeV
MeV
MeV
MeV
OR
JNZ
JMP
INC
MeV
SUB
MeV
OUT
JMP
SUB
MeV
OUT
JMP
INC
MeV
OUT
JMP
ADD
MeV
OUT
JMP
MeV
MeV
LES
MeV
SHR
ADD
MeV
CLI
MeV
CMP
JZ
CMP
JZ
CMP
JZ
INC
JMP
INC
MeV
SUB
JB
CMP
JA
CBW
SHL
MeV
JMP
; I n 1 t 1a11z1
"'0
d I"' con t r
0
1 rig 11 t I r .
;Initialize lint control regilttr.
83 C2 02
BO 03
EE
EB 00
83 EA 02
BO 80
EE
EB 00
83 EA 03
BO 60
EE
EB 00
42
BO 00
EE
E8 00
42
BO OB
BB 0000
26' C4 70 12
83
C2
05
fC
fB 00
BA 0054
B4 09
CO 21
8B 08
Dl EB
80 C3 31
2E:
88 IE
OOCl
R
FA
2E: C7 06 0128 R 0000
8B
Fa
88 0040
8E CO
26
8B 15
OB D2
75
03
E9 03B2
R
26: SA
01
3C 2F
74
OB
3C 00
74 lC
3C OA
74 18
43
EB EE
43
28
8A
01
2C
31
72 00
3C 03
77
09
98
01 EO
2E
A3 0128 R
EB 07
OlCI
02C4
02F6
02F 8
02FA
02FD
0302
0314
0317
0318
0330
0333
0335
0336
0303
0305
0308
030A
030D
030F
0311
031A
031D
031F
0320
0322
0325
0327
0328
032A
0328
0320
032£
02BA
0280
02BF
0338
033i
02ca
02CB
02CO
02CF
0201
0203
0205
0207
0208
020A
020B
OlOE
02EO
02E2
02E4
02E6
02E7
02E9
02EO
02EF
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
e92
693
694
695
696
697
698
699
700
701
702
703
704
70S
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
Driver Writer's Guide 469
Need help?
Do you have a question about the Vectra and is the answer not in the manual?
Questions and answers