diff options
Diffstat (limited to 'opcodes/moxie-dis.c')
-rw-r--r-- | opcodes/moxie-dis.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c index 79ef099..77821bb 100644 --- a/opcodes/moxie-dis.c +++ b/opcodes/moxie-dis.c @@ -53,7 +53,11 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) if ((status = info->read_memory_func (addr, buffer, 2, info))) goto fail; - iword = bfd_getb16 (buffer); + + if (info->endian == BFD_ENDIAN_BIG) + iword = bfd_getb16 (buffer); + else + iword = bfd_getl16 (buffer); /* Form 1 instructions have the high bit set to 0. */ if ((iword & (1<<15)) == 0) @@ -79,7 +83,10 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) unsigned imm; if ((status = info->read_memory_func (addr + 2, buffer, 4, info))) goto fail; - imm = bfd_getb32 (buffer); + if (info->endian == BFD_ENDIAN_BIG) + imm = bfd_getb32 (buffer); + else + imm = bfd_getl32 (buffer); fpr (stream, "%s\t%s, 0x%x", opcode->name, reg_names[OP_A(iword)], imm); length = 6; @@ -90,7 +97,10 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) unsigned imm; if ((status = info->read_memory_func (addr + 2, buffer, 4, info))) goto fail; - imm = bfd_getb32 (buffer); + if (info->endian == BFD_ENDIAN_BIG) + imm = bfd_getb32 (buffer); + else + imm = bfd_getl32 (buffer); fpr (stream, "%s\t0x%x", opcode->name, imm); length = 6; } @@ -100,7 +110,10 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) unsigned imm; if ((status = info->read_memory_func (addr + 2, buffer, 4, info))) goto fail; - imm = bfd_getb32 (buffer); + if (info->endian == BFD_ENDIAN_BIG) + imm = bfd_getb32 (buffer); + else + imm = bfd_getl32 (buffer); fpr (stream, "%s\t", opcode->name); info->print_address_func ((bfd_vma) imm, info); length = 6; @@ -119,7 +132,10 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) unsigned imm; if ((status = info->read_memory_func (addr + 2, buffer, 4, info))) goto fail; - imm = bfd_getb32 (buffer); + if (info->endian == BFD_ENDIAN_BIG) + imm = bfd_getb32 (buffer); + else + imm = bfd_getl32 (buffer); fpr (stream, "%s\t0x%x, %s", opcode->name, imm, reg_names[OP_A(iword)]); length = 6; @@ -130,7 +146,10 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) unsigned imm; if ((status = info->read_memory_func (addr+2, buffer, 4, info))) goto fail; - imm = bfd_getb32 (buffer); + if (info->endian == BFD_ENDIAN_BIG) + imm = bfd_getb32 (buffer); + else + imm = bfd_getl32 (buffer); fpr (stream, "%s\t0x%x(%s), %s", opcode->name, imm, reg_names[OP_A(iword)], @@ -143,7 +162,10 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) unsigned imm; if ((status = info->read_memory_func (addr+2, buffer, 4, info))) goto fail; - imm = bfd_getb32 (buffer); + if (info->endian == BFD_ENDIAN_BIG) + imm = bfd_getb32 (buffer); + else + imm = bfd_getl32 (buffer); fpr (stream, "%s\t%s, 0x%x(%s)", opcode->name, reg_names[OP_A(iword)], |