This is the mail archive of the
mailing list for the binutils project.
Re: objdump -D option gives different numbers in different bases
> Hello Thiemo
> >It's hardcoded in opcodes/mips-dis.c. Unsigned immediates are in hex,
> >signed immediates are in dec. Other numbers are in hex, with the
> >exception of mtc*/mfc* fields and performance counter registers.
> I am seeing more decimal used that this, signed is best in decimal,
I don't see why we shouldn't use signed hex values. For the example
you mentioned below it would be more readable.
> but there are other opcodes using decimal:
> above some unsigned values are comming out in decimal.
AFAICS all of these are signed immediate values. Please note that
e.g. "daddiu" is somewhat of a misnomer and means "add signed
immediate without overflow checking".
> >Maybe we should generally standardize on hex output.
> I think for the majority of the opcodes hex is best IMO, but this could
> be controled by options if people need to force to hex,dec or oct.
There are many things which could be done. :-) If you want to
implement this, I would recommend to use hex as default.
> >This is output from an older toolchain which gets the register names
> >wrong (it's either k0 or $26).
> Yes, its an older toolchain, k0 is r26, what do you mean is wrong? the $?
Yes. It also confuses register naming for SGI-ish NewABI.