Date: Tue, 11 Oct 94 20:42:47 +0100 From: buers AT dg1 DOT chemie DOT uni-konstanz DOT de (Dieter Buerssner) To: babcock AT cfa DOT harvard DOT edu Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: bug in movedata (or in gas), with fix Dear Bob Babcock, > In the file dosmem.s in libsrc/c/dos gas produces for the jcxz zero > instructions code for a jump with 16 bit displacements. This will mask > the high word of EIP, so (when cx is zero) it will jump from say > 0x00012345 to 0x00002347 instead of the correct 0x00012347. In the > gas manual, there is mentioned, that using jcxz may be risky, but I > really don't understand what they mean. The code should get assembled > correctly (with 8-bit displacement, "short" jump). The following > patch seems to fix the problem (using jz instead of jcxz). I just looked at some of my code with the debugger. The two jcxz instructions in dosmem.s seem to be assembled with 8-bit displacements in the standard distribution, not 16-bit. Did you rebuild the library, and if so, did you use a different version of gas than DJ uses? You are right, I actually recompiled the library. I thought I recompiled with the newest tools from djgpp1.12 (I have no space for old versions), but I will check the version of gas I used. You might have seen a similar message Sven Palme , sent to the djgpp mailing list on 10th Oct., who noted the 0x66 Prefix for the jcxz instruction as well. Regards, Dieter