Mail Archives: djgpp/1999/09/02/15:40:30
On Tue, 31 Aug 1999, David Dean - [DS]Deaner666 wrote:
> This works fine, except it doesn't give values in the range 0 - 319 for the
> x axis and 0 - 199 for the y axis (I'm using mode 13h).
I believe you are being hit by the 16-bitness as opposed to 32-bitness
of the registers in union REGS. Did you read the documentation of
`int86' in the library reference? If not, type "info libc alpha int86"
from the command line and read there.
Generally, I'd recommend to stay away of `int86' altogether, and use
`__dpmi_int' instead. Section 18.1 of the DJGPP FAQ list explains
why; here's an excerpt:
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
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
- Raw text -