Date: Thu, 22 Oct 1998 20:43:59 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: new user - mouse problems In-Reply-To: <6NHX1.918$H9.138159@proxye1.nycap.rr.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Thu, 22 Oct 1998, Matthew Conte wrote: > Section 18.1 of the FAQ says nothing about the size of the regs. Yes, it does (see the excerpt below). Maybe you have an old version; the latest is in v2/faq211b.zip. Excerpt from the FAQ v2.11, section 18.1: Note that calling `int86' and `intdos' can sometimes cause trouble due to size (16 bits as opposed to 32 bits) of the members in the `union REGS' structure. Do *not* assume that e.g. `regs.x.ax' is always 16 bit! This problem and the facilities available to specify the width of the registers are all described in the library reference; see description of the int86 function in "libc.a reference", or point your Web browser to http://www.delorie.com/djgpp/doc/libc-2.01/libc_411.html#SEC411. In particular, programs which interface with the mouse via calls to the `int86' library function, should mask off the high 16 bits of the registers which report mouse position and other values, since the high 16 bits aren't necessarily zeroed (which will wreak havoc in any program that interfaces to the mouse). > Sure looks to me like the regs are 16-bit, and would explain why the values > returned when you assumed 32-bit integers are garbage. Please read a few sentences more: The `.x.' members behave according to `#defines', as follows: `default' If you specify no `#define', the `.x.' branch has "`ax'" members and is 32-bit. This is compatible with previous versions of djgpp. See? The default is 32-bit .ax members, and most DOS code ported from other compilers assumes they are 16 bits. If you want them to be 16 bit, use _NAIVE_DOS_REGS.