This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Fix i8086 disassembler for 16bit displacements
On Mon, Feb 05, 2007 at 10:47:07AM +0200, Bernd Jendrissek wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Fri, Feb 02, 2007 at 04:37:37PM -0800, H. J. Lu wrote:
> > 2076-02-02 H.J. Lu <hongjiu.lu@intel.com>
> ^^^^
> May I borrow your time machine please?
>
> > * i386-dis.c (OP_J): Only mask to 16bit if there is a data16
> > prefix.
> >
> > --- binutils/ld/testsuite/ld-i386/pcrel16.d.disp 2006-01-18 13:07:49.000000000 -0800
> > +++ binutils/ld/testsuite/ld-i386/pcrel16.d 2007-02-02 15:22:36.000000000 -0800
> > @@ -12,4 +12,4 @@ Disassembly of section .text:
> > 420: cd 42[ ]+int \$0x42
> > 422: ca 02 00[ ]+lret \$0x2
> > ...
> > - f065: e9 b8 13[ ]+jmp 420 <_start\+0x420>
> > + f065: e9 b8 13[ ]+jmp 10420 <__bss_start\+0x3b8>
> ^^^^^
> What does a 16-bit processor, or a 32 or 64-bit one in 16-bit mode, know
> of addresses greater than 0xffff?
>
> I don't understand under which circumstances it is ever correct to
> disassemble a jump target to greater than 0xffff if it is known to be a
> 16-bit displacement. Can you explain to me when this would be correct?
>
Jmp is PC relative. Disassembler displays the jump target as
PC + distance, which may be greater than 0xffff.
H.J.