public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] opcodes: SH fix bank register disassemble.
@ 2022-09-14  2:44 Yoshinori Sato
  2022-09-22 11:41 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Yoshinori Sato @ 2022-09-14  2:44 UTC (permalink / raw)
  To: binutils; +Cc: Yoshinori Sato

Bit7 of LDC Rm,Rn_BANK and STC Rm_BANK,Rn is always 1.
Since it is not confirmed that this is 1 now,
it was outputting incorrect code as a correct instruction.

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 opcodes/sh-dis.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/opcodes/sh-dis.c b/opcodes/sh-dis.c
index 0e46cb6f4d9..6c8bd7b1cd7 100644
--- a/opcodes/sh-dis.c
+++ b/opcodes/sh-dis.c
@@ -645,6 +645,8 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
 	      rm = (nibs[n] & 0x3);
 	      break;
 	    case REG_B:
+	      if (!(nibs[n] & 0x08)) /* always 1*/
+		goto fail;
 	      rb = nibs[n] & 0x07;
 	      break;
 	    case SDT_REG_N:
-- 
2.30.2


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

end of thread, other threads:[~2022-09-22 11:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14  2:44 [PATCH] opcodes: SH fix bank register disassemble Yoshinori Sato
2022-09-22 11:41 ` Nick Clifton

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).