www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/07/20/00:11:17

Date: Wed, 19 Jul 1995 23:18:53 -0400
From: dj (DJ Delorie)
To: empty AT sans DOT vuw DOT ac DOT nz
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: Possible GCC (v2.0-beta) bug.

> 	I have just finished removing a 'bug' from my code, which seems 
> very much to have been caused by the compiler. I was doing a compare of a 
> register (union REGS) r.x.cx!=0 and this was coming out true even when 
> r.x.cx==0. I have a feeling that the compiler was comparing a full int (4 
> bytes) instead of a word with zero. I have removed this by getting the 
> values with inline assembly instead.

In djgpp, r.x.cx *is* four bytes.  Don't forget that on 80386, the
registers are 32-bits!  You must mask off the bits you're interested
in.

Note that in the V2 DPMI register struct (__dpmi_regs), r.x.cx is two
bytes and r.d.ecx is four.

- Raw text -


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