Mail Archives: djgpp/1995/07/20/00:11:17
> 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 -