X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=opcodes%2Fmoxie-dis.c;h=cbfcf958806831bcd32b85eca1fdb9f891e6e65b;hb=3cb5a3a16af2cae1a5059b7571c514b3fa575df9;hp=953497e8cfc8bd684f89a623c7ca36e6dbc910d7;hpb=b90efa5b79ac1524ec260f8eb89d1be37e0219a7;p=deliverable%2Fbinutils-gdb.git diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c index 953497e8cf..cbfcf95880 100644 --- a/opcodes/moxie-dis.c +++ b/opcodes/moxie-dis.c @@ -1,5 +1,5 @@ /* Disassemble moxie instructions. - Copyright (C) 2009-2015 Free Software Foundation, Inc. + Copyright (C) 2009-2019 Free Software Foundation, Inc. This file is part of the GNU opcodes library. @@ -25,7 +25,7 @@ #define DEFINE_TABLE #include "opcode/moxie.h" -#include "dis-asm.h" +#include "disassemble.h" static fprintf_ftype fpr; static void *stream; @@ -33,7 +33,7 @@ static void *stream; /* Macros to extract operands from the instruction word. */ #define OP_A(i) ((i >> 4) & 0xf) #define OP_B(i) (i & 0xf) -#define INST2OFFSET(o) ((((signed short)((o & ((1<<10)-1))<<6))>>6)<<1) +#define INST2OFFSET(o) (((((o) & 0x3ff) ^ 0x200) - 0x200) << 1) static const char * reg_names[16] = { "$fp", "$sp", "$r0", "$r1", "$r2", "$r3", "$r4", "$r5", @@ -210,7 +210,7 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info) { case MOXIE_F3_PCREL: fpr (stream, "%s\t", opcode->name); - info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword) + 2), + info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword) + 2), info); break; case MOXIE_BAD: