🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #585

Re: Mouse programming

#585
From: Jerzy Tarasiuk
Date: Fri, 09 Oct 1992 14:07
20 lines
1709 bytes
>>>>> On Mon, 5 Oct 1992 16:24:03 GMT, gay@selkirk.sfu.ca (Ian D. Gay) said:
Ian> stuartw@ccu1.aukuni.ac.nz (Stuart Woolford) writes:
>How do you write a routine in pascal ( or C...asm...etc ) which will be called
>by the standard callback function of the driver ( when a button is pressed, etc
>), and which can still address the programs global variables, the problem is
>that, when the routine is called, DS points at the MOUSE DRIVERS data segment,
>and I at least could not think of an easy way to address the programs global
>data, which will NOT be at a fixed address :-(
Ian> I have used the following as inline assembler with Turbo-C. It works. 
Ian> I couldn't think of a pure C way to do it.
Ian>     push ds
Ian>     mov  ds seg DGROUP

It can be done in C if you use HUGE memory model to compile the
procedure (in HUGE model DS is set on entry to procedure).
Or, if the driver can call procedure pushing flags before the call,
it (the procedure) can be declared as interrupt procedure.
But, anyway, stack size may be a problem (I remember problems with
VDISK which uses local stack of small size, and an interrupt while
VDISK processed its "I/O" sometimes caused crash).
Technical Details
Message-ID: <JT.92Oct9150738@fizyk1.fuw.edu.pl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!fuw.edu.pl!cocos!jt
References: <1992Oct5.000501.3735@ccu1.aukuni.ac.nz> <gay.718302243@sfu.ca>

Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sunic!fuw.edu.pl!cocos!jt
From: jt@fuw.edu.pl (Jerzy Tarasiuk)
Subject: Re: Mouse programming
In-Reply-To: gay@selkirk.sfu.ca's message of Mon, 5 Oct 1992 16:24:03 GMT
Message-ID: <JT.92Oct9150738@fizyk1.fuw.edu.pl>
Sender: news@fuw.edu.pl
Nntp-Posting-Host: fizyk1
Organization: Warsaw University Physics Dept.
References: <1992Oct5.000501.3735@ccu1.aukuni.ac.nz> <gay.718302243@sfu.ca>
Date: Fri, 9 Oct 1992 14:07:38 GMT
Lines: 20