www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/09/06:57:55

Date: Wed, 9 Apr 1997 13:35:22 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Peter Steele <ps13 AT ic DOT ac DOT uk>
cc: djgpp AT delorie DOT com
Subject: Re: Mouse graphics
In-Reply-To: <334A816F.F058107@ic.ac.uk>
Message-ID: <Pine.SUN.3.91.970409133426.3639R-100000@is>
MIME-Version: 1.0

On Tue, 8 Apr 1997, Peter Steele wrote:

>    r.x.dx = (__tb & 0x000fffff) & 0xffff;
>    r.x.es = (__tb & 0x000fffff) & 0xffff0000 >>4;

This is incorrect and also unnecessarily complicated.  Just say so:

   r.x.dx = __tb & 0xf;
   r.x.es = (__tb >> 4) & 0xffff;

I didn't test your program after this correction, so I cannot
guarantee that this is the only problem.  But it corrects at least one
error in your code which shifts left 0xffff0000 instead of __tb,
because the precedence of the >> operator is higher than that of &.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019