Mail Archives: djgpp/1994/10/13/10:31:32
Hi!
There seem to be some confusion about the movedata.s bug. Let
me first say that it *is* a bug and has *nothing* to do with
recompilation of the libraries.
The Intel manuals say that the operation is
if <condition> then
eip = eip + signextend(rel8/rel16/rel32)
if <operandsize=16> then
eip = eip & 0000FFFFh
modulo my memory. Note that it is the *operand size* (not
the address size, not the size of the relative address) that
determines whether the high bits are masked. This means that
"Jcxz" (not "Jecxz") is no good in 32-bit programs.
(And by the way, there is no Jcxz that has a 16-bit or 32-bit
relative address.)
In libc.a you will twice find the sequence
66 E2? 02 Jcxz over
?? ?? Rep movs?
over: ...
Note that the operand size prefix (66) is present (to select cx
over ecx) and that the high bits are therefore masked. That is
bad, and incidently: "jz over" would have worked just find.
I hope I have spread some light.
Morten Welinder
terra AT diku DOT dk
- Raw text -