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
> 
> I just realised that sometimes -D will give me decimal sometimes for 
> mips and other times Hex for the arguments to each opcode.
> 
> There is no option I can find to set that, is it fixed to be sometimes 
> decimal and sometimes hex in the sourcecode?

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.

Maybe we should generally standardize on hex output.

> a simple example.
> 
> xxx: 
> 8c322935 	ori	$t1,$t1,0x328c
> xxx: 
> 800009fd 	sd	$t1,128($t0)
> xxx: 
> ff000924 	li	$t1,255
> xxx: 
> 880051ff 	sd	$s1,132($k0)
> xxx: 
> 900052ff 	sd	$s2,140($k0)

This is output from an older toolchain which gets the register names
wrong (it's either k0 or $26).

> relative addressing from $k0 could be controled, and also the code that 
> decided the li instruction and the ori instruction.
> 
> if there was a --use-base-dec and --use-base-hex (default) that would be 
> very useful I think.

Why do you thinks it's useful? It looks to be a nice-to-have thing.


Thiemo


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