From 0e7c7f11f471e3350d50c08fda8e3ddf055940f2 Mon Sep 17 00:00:00 2001 From: Anthony Green Date: Sat, 6 Jun 2009 13:02:21 +0000 Subject: Print moxie addresses nicely. --- opcodes/ChangeLog | 5 +++++ opcodes/moxie-dis.c | 11 +++++++++++ opcodes/moxie-opc.c | 24 ++++++++++++------------ 3 files changed, 28 insertions(+), 12 deletions(-) (limited to 'opcodes') diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 7b8e100..8333e32 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,8 @@ +2009-06-06 Anthony Green + + * moxie-opc.c: Recode some MOXIE_F1_4 opcodes as MOXIE_F1_M. + * moxie-dis.c (print_insn_moxie): Handle MOXIE_F1_M case. + 2009-06-04 Alan Modra * dep-in.sed: Don't use \n in replacement part of s command. diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c index b1d123f..d63eb2d 100644 --- a/opcodes/moxie-dis.c +++ b/opcodes/moxie-dis.c @@ -93,6 +93,17 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) length = 6; } break; + case MOXIE_F1_M: + { + unsigned imm; + if ((status = info->read_memory_func (addr + 2, buffer, 4, info))) + goto fail; + imm = bfd_getb32 (buffer); + fpr (stream, "%s\t", opcode->name); + info->print_address_func ((bfd_vma) imm, info); + length = 6; + } + break; case MOXIE_F1_AiB: fpr (stream, "%s\t(%s), %s", opcode->name, reg_names[OP_A(iword)], reg_names[OP_B(iword)]); diff --git a/opcodes/moxie-opc.c b/opcodes/moxie-opc.c index 559cd11..7275e3a 100644 --- a/opcodes/moxie-opc.c +++ b/opcodes/moxie-opc.c @@ -55,7 +55,7 @@ const moxie_opc_info_t moxie_form1_opc_info[64] = { 0x00, MOXIE_F1_NARG, "nop" }, { 0x01, MOXIE_F1_A4, "ldi.l" }, { 0x02, MOXIE_F1_AB, "mov" }, - { 0x03, MOXIE_F1_4, "jsra" }, + { 0x03, MOXIE_F1_M, "jsra" }, { 0x04, MOXIE_F1_NARG, "ret" }, { 0x05, MOXIE_F1_AB, "add.l" }, { 0x06, MOXIE_F1_AB, "push" }, @@ -67,18 +67,18 @@ const moxie_opc_info_t moxie_form1_opc_info[64] = { 0x0c, MOXIE_F1_ABi4, "ldo.l" }, { 0x0d, MOXIE_F1_AiB4, "sto.l" }, { 0x0e, MOXIE_F1_AB, "cmp" }, - { 0x0f, MOXIE_F1_4, "beq" }, - { 0x10, MOXIE_F1_4, "bne" }, - { 0x11, MOXIE_F1_4, "blt" }, - { 0x12, MOXIE_F1_4, "bgt" }, - { 0x13, MOXIE_F1_4, "bltu" }, - { 0x14, MOXIE_F1_4, "bgtu" }, - { 0x15, MOXIE_F1_4, "bge" }, - { 0x16, MOXIE_F1_4, "ble" }, - { 0x17, MOXIE_F1_4, "bgeu" }, - { 0x18, MOXIE_F1_4, "bleu" }, + { 0x0f, MOXIE_F1_M, "beq" }, + { 0x10, MOXIE_F1_M, "bne" }, + { 0x11, MOXIE_F1_M, "blt" }, + { 0x12, MOXIE_F1_M, "bgt" }, + { 0x13, MOXIE_F1_M, "bltu" }, + { 0x14, MOXIE_F1_M, "bgtu" }, + { 0x15, MOXIE_F1_M, "bge" }, + { 0x16, MOXIE_F1_M, "ble" }, + { 0x17, MOXIE_F1_M, "bgeu" }, + { 0x18, MOXIE_F1_M, "bleu" }, { 0x19, MOXIE_F1_A, "jsr" }, - { 0x1a, MOXIE_F1_4, "jmpa" }, + { 0x1a, MOXIE_F1_M, "jmpa" }, { 0x1b, MOXIE_F1_A4, "ldi.b" }, { 0x1c, MOXIE_F1_ABi, "ld.b" }, { 0x1d, MOXIE_F1_A4, "lda.b" }, -- cgit v1.1