aboutsummaryrefslogtreecommitdiff
path: root/opcodes/moxie-dis.c
diff options
context:
space:
mode:
authorAnthony Green <green@redhat.com>2009-06-11 11:27:58 +0000
committerAnthony Green <green@redhat.com>2009-06-11 11:27:58 +0000
commitf865a31d1ed571ccb8d17653b150e3a30f22b30d (patch)
tree53213b9fa3500e9762839a2a15d4447b6e7c04cc /opcodes/moxie-dis.c
parent1372b818548793632310cb702930171c849f62db (diff)
downloadgdb-f865a31d1ed571ccb8d17653b150e3a30f22b30d.zip
gdb-f865a31d1ed571ccb8d17653b150e3a30f22b30d.tar.gz
gdb-f865a31d1ed571ccb8d17653b150e3a30f22b30d.tar.bz2
Add PC-relative branch instructions to moxie port.
Diffstat (limited to 'opcodes/moxie-dis.c')
-rw-r--r--opcodes/moxie-dis.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/opcodes/moxie-dis.c b/opcodes/moxie-dis.c
index d63eb2d..4e67e2c 100644
--- a/opcodes/moxie-dis.c
+++ b/opcodes/moxie-dis.c
@@ -33,6 +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)
static const char * reg_names[16] =
{ "$fp", "$sp", "$r0", "$r1", "$r2", "$r3", "$r4", "$r5",
@@ -176,11 +177,13 @@ print_insn_moxie (bfd_vma addr, struct disassemble_info * info)
else
{
/* Extract the Form 3 opcode. */
- opcode = &moxie_form2_opc_info[(iword >> 12) & 3];
+ opcode = &moxie_form3_opc_info[(iword >> 10) & 15];
switch (opcode->itype)
{
- case MOXIE_F3_NARG:
- fpr (stream, "%s", opcode->name);
+ case MOXIE_F3_PCREL:
+ fpr (stream, "%s\t", opcode->name);
+ info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword)),
+ info);
break;
default:
abort();