This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Fix i8086 disassembler for 16bit displacements
- From: Andreas Schwab <schwab at suse dot de>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 03 Feb 2007 01:51:44 +0100
- Subject: Re: PATCH: Fix i8086 disassembler for 16bit displacements
- References: <20070203003737.GA6527@lucon.org>
"H. J. Lu" <hjl@lucon.org> writes:
> --- binutils/opcodes/i386-dis.c.disp 2007-02-02 13:50:51.000000000 -0800
> +++ binutils/opcodes/i386-dis.c 2007-02-02 14:34:00.000000000 -0800
> @@ -4916,10 +4916,13 @@ OP_J (int bytemode, int sizeflag)
> else
> {
> disp = get16 ();
> + if ((disp & 0x8000) != 0)
> + disp -= 0x10000;
> /* For some reason, a data16 prefix on a jump instruction
> means that the pc is masked to 16 bits after the
> displacement is added! */
> - mask = 0xffff;
> + if ((prefixes & PREFIX_DATA))
Please write it like this:
if ((prefixes & PREFIX_DATA) != 0)
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."