Wed Jan 28 16:41:19 1998 J.J. van der Heijden <J.J.vanderHeijden@student.utwente.nl>
[deliverable/binutils-gdb.git] / opcodes / txvu-dis.c
index 8652f12b92e8f724a7338e1a3d50c960338c81d6..eccb0e8432a5db0f00ceebf4c6b676fad65df473 100644 (file)
@@ -50,8 +50,9 @@ print_insn_txvu (pc, info)
       (*info->memory_error_func) (status, pc, info);
       return -1;
     }
-  upper = bfd_getl32 (buffer);
-  lower = bfd_getl32 (buffer + 4);
+  /* The lower instruction has the lower address.  */
+  upper = bfd_getl32 (buffer + 4);
+  lower = bfd_getl32 (buffer);
 
   /* FIXME: This will need revisiting.  */
   print_insn (pc, info, upper, 0);
@@ -78,7 +79,7 @@ print_insn (pc, info, insn, lower_p)
      TXVU_INSN insn;
      int lower_p;
 {
-  const struct txvu_opcode *opcode;
+  const txvu_opcode *opcode;
   void *stream = info->stream;
   fprintf_ftype func = info->fprintf_func;
 
@@ -94,7 +95,7 @@ print_insn (pc, info, insn, lower_p)
       const unsigned char *syn;
       int mods,invalid,num_operands;
       long value;
-      const struct txvu_operand *operand;
+      const txvu_operand *operand;
 
       /* Basic bit mask must be correct.  */
       if ((insn & opcode->mask) != opcode->value)
@@ -124,7 +125,7 @@ print_insn (pc, info, insn, lower_p)
            }
          operand = txvu_operands + index;
          if (operand->extract)
-           (*operand->extract) (insn, operand, mods, &invalid);
+           (*operand->extract) (opcode, operand, mods, &insn, &invalid);
        }
       if (invalid)
        continue;
@@ -157,7 +158,8 @@ print_insn (pc, info, insn, lower_p)
          /* Extract the value from the instruction.  */
          if (operand->extract)
            {
-             value = (*operand->extract) (insn, operand, mods, (int *) NULL);
+             value = (*operand->extract) (opcode, operand, mods,
+                                          &insn, (int *) NULL);
            }
          else
            {
@@ -167,17 +169,19 @@ print_insn (pc, info, insn, lower_p)
                value -= 1 << operand->bits;
            }
 
+#if 0 /* commas are part of the syntax string now */
          /* If second or later operand, print a comma.  */
          if (num_operands > 0)
            (*func) (stream, ",");
+#endif
 
          /* Print the operand as directed by the flags.  */
          if (operand->print)
-           (*operand->print) (info, insn, value);
+           (*operand->print) (opcode, operand, mods, &insn, info, value);
          else if (operand->flags & TXVU_OPERAND_FAKE)
            ; /* nothing to do (??? at least not yet) */
          else if (operand->flags & TXVU_OPERAND_RELATIVE_BRANCH)
-           (*info->print_address_func) (pc + value, info);
+           (*info->print_address_func) (pc + (value << 3), info);
          /* ??? Not all cases of this are currently caught.  */
          else if (operand->flags & TXVU_OPERAND_ABSOLUTE_BRANCH)
            (*info->print_address_func) ((bfd_vma) value & 0xffffffff, info);
This page took 0.025571 seconds and 4 git commands to generate.