🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #6954

Re: Help with mouse driver! Is Logi 5 diff from Log 4?

#6954
From: Frank Seidinger
Date: Tue, 04 Jun 1991 17:35
47 lines
2946 bytes
sorrow@oak.circa.ufl.edu writes:

>Hi all.  I have been using my own mouse routines and installed my own mouse
>interrupt handler.  Here is the problem:

>1.  I am using a 386/33 using Borland C++ (BC /X, not BCX).
>2.  When running Logitech Mouse Driver 5.00 I have found that when I run my
>program I get a "Stack Overflow!" error.  I have stack checking enabled.
>This happens on my 386 but not on a 286.
>3.  This does not happen using Logitech Mouse 4.00.
>4.  The stack overflow occurs the SECOND I TOUCH THE MOUSE after my routines
>to install my mouse handler (call back function) are executed.
>5.  The machine will work inconsistently with stack checking off.

I had to do the same thing in Turbo Pascal. So I found out, that it was not
to do with some support of assemby code. If you are familar with assembly, drop
me a mail and I will send you my complete solution. For now here are some
hints:

The new handler has to end with an RET, because it is called from the mouse
driver via CALL FAR. Therefore neither the deklaration as an Interrupt
Procedure (I'm speaking Turbo Pascal, but should be similar in C), nor a normal
deklaration will work.

The DS register has to be set up for using with your program. The Turbo Linker
and other will help you with an predefined symbol called DATA, that can be used
with an assembler. The code can be linked with your program using the object-
file method. The reason for that is mentioned by an other writer (asynchronous
call).

After setting up the DS register and preserving the other ones needed, you
are able to call your own procedures from within the interrupt. Also here
you will be helped by the linker. You only have to deklare the procedures
you want to use from within your handler as externals in the assembly code.

And of course you have to disable stack and range checking.

hope this helps, Frank.

----------------------------------------------------------------------
>>>>>>>>>>>>>>>>>> Wenn alles egal ist,  Budweiser ! <<<<<<<<<<<<<<<<<
----------------------------------------------------------------------
*   \/|\/     _          *                                           *
*  \/\|/\/   /  \        *  e-mail   docbrain@netmbx.in-berlin.de    *
*    \|/    | @  |       *           docbrain%netmbx@db0tui6.bitnet  *    
*     |     |   A|       *           docbrain%netmbx@tub.uucp        *
----------------------------------------------------------------------
Technical Details
Message-ID: <2376@netmbx.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!spool.mu.edu!uunet!math.fu-berlin.de!opal!tmpmbx!netmbx!docbrain
References: <00949912.601AB080@MAPLE.CIRCA.UFL.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!spool.mu.edu!uunet!math.fu-berlin.de!opal!tmpmbx!netmbx!docbrain
From: docbrain@netmbx.UUCP (Frank Seidinger)
Newsgroups: comp.os.msdos.programmer
Subject: Re: Help with mouse driver! Is Logi 5 diff from Log 4?
Message-ID: <2376@netmbx.UUCP>
Date: 4 Jun 91 17:35:47 GMT
References: <00949912.601AB080@MAPLE.CIRCA.UFL.EDU>
Organization: netmbx, Berlin, Germany
Lines: 47