public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Why aren't we consistent on displacement in x86 disassembler?
@ 2007-04-26 14:43 H. J. Lu
  2007-04-26 14:54 ` H. J. Lu
  0 siblings, 1 reply; 14+ messages in thread
From: H. J. Lu @ 2007-04-26 14:43 UTC (permalink / raw)
  To: binutils

While working on

http://sourceware.org/bugzilla/show_bug.cgi?id=4429

I noticed that we weren't consistent in the format we use on
displacement:

----
static void
print_operand_value (char *buf, int hex, bfd_vma disp)
...
static void
OP_E (int bytemode, int sizeflag)
{
...
	    print_operand_value (scratchbuf, !riprel, disp);
...
	      print_operand_value (scratchbuf, modrm.mod != 1, disp);
...
	      print_operand_value (scratchbuf, 1, disp);
...
	    print_operand_value (scratchbuf, 0, disp);
...
	      print_operand_value (scratchbuf, modrm.mod != 1, disp);
...
	  print_operand_value (scratchbuf, 1, disp & 0xffff);
}
----

That is we use hex or decimal for displacement, depending on Intel
mode, RIP relative, modrm.mod != 1 and 16bit address mode. It is
confusing. Are there any objections if I use hex for all displacements?


H.J.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-04-27 14:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-26 14:43 Why aren't we consistent on displacement in x86 disassembler? H. J. Lu
2007-04-26 14:54 ` H. J. Lu
2007-04-26 15:54   ` Jan Beulich
2007-04-26 15:59     ` H. J. Lu
2007-04-26 16:05       ` Jan Beulich
2007-04-26 16:23         ` H. J. Lu
2007-04-26 16:31     ` Alan Modra
2007-04-26 17:19       ` H. J. Lu
2007-04-27  8:40         ` PATCH: PR binutils/4430: We aren't consistent on displacement in x86 disassembler H. J. Lu
2007-04-27 12:40           ` PATCH: Little endian target "binary_little" Kai Tietz
2007-04-27 13:54             ` Alan Modra
2007-04-27 14:54               ` Kai Tietz
2007-04-27 16:26                 ` Alan Modra
2007-04-27 13:39           ` PATCH: PR binutils/4430: We aren't consistent on displacement in x86 disassembler Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).