Why aren't we consistent on displacement in x86 disassembler?

Alan Modra amodra@bigpond.net.au
Thu Apr 26 16:31:00 GMT 2007


On Thu, Apr 26, 2007 at 04:36:25PM +0100, Jan Beulich wrote:
> >We can do one of
> >
> >1. Use decimal on all 8bit displacements and hex on all 16/32bit
> >displacement.
> >2. Use hex on all displacements.
> >
> >Any comments?
> 
> I'd prefer option 2. Jan

Consistency is good, but print_operand_value isn't very nice.  eg. a
displacement of -4 in hex is printed as 0xfffffffc (and even more f's
if 64-bit).  If we go to all hex, I'd like to see 8 bit displacements
printed as signed hex numbers, eg. 0xe8 prints as -0x18.  Perhaps you
could drop the 0x on values of -9 to 9.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list