This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: objdump -D option gives different numbers in different bases


openssh wrote:
> 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:
> 
> ldr 
> t7,10104(t2)
> daddiu 
> s3,t2,30004
> ldr 
> a2,8302(s2)
> jalx 
> 0xb1c004d0
> 
> ldr 
> t5,26477(t2)
> addi 
> s4,v1,23261
> sltiu 
> v0,s2,23233
> nop
> daddi 
> zero,t8,20338
> daddi 
> s1,t2,27015
> ldr 
> v0,25996(v2)
> ldr 
> t4,8223(k0)
> daddi 
> zero,s2,24956
> sltiu 
> t4,s1,8303
> 
> 
> 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.


Thiemo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]