shifts and rotates by 1 on ix86
Maciej W. Rozycki
macro@ds2.pg.gda.pl
Thu May 11 03:56:00 GMT 2000
On Thu, 11 May 2000, Alan Modra wrote:
> > However, implicit 1-bit shifts and rotates do set flags differently than
> > the explicit forms.
>
> Are you sure about this statement? My reading of the Intel arch
> instruction set manual indicates that the overflow flag is set
> appropriately for 1 bit shifts, and undefined for > 1 bit shifts.
> There is no mention of a difference depending on which of the one bit
> shift instructions is used.
I can recall a reference to some instruction setting flags differently
based on its encoding. Now I couldn't find it. I tested both encodings
under a debugger and it proved I was wrong.
Hmm, after a bit of thinking, I believe the reference could be about
Z80's rotate opcodes -- it has two encodings for some of them of which the
8080-compatible accumulator-only one sets flags differently (only CF is
updated) comparing to the Z80-specific any-register one (all flags are set
accordingly).
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
More information about the Binutils
mailing list