Automatic date update in version.in
[deliverable/binutils-gdb.git] / opcodes / s12z-dis.c
index 14176fb6d9e47f83280ec0c8eacfcfea4d1a113e..d4d5fd7217f03523d2f4a21c8a0998cd768d98e9 100644 (file)
@@ -282,36 +282,33 @@ opr_emit_disassembly (const struct operand *opr,
         struct memory_operand *mo = (struct memory_operand *) opr;
        (*info->fprintf_func) (info->stream, "%c", mo->indirect ? '[' : '(');
 
-        if (mo->base_offset != 0)
-          {
-            (*info->fprintf_func) (info->stream, "%d", mo->base_offset);
-          }
-        else if (mo->n_regs > 0)
-          {
-           const char *fmt;
-           switch (mo->mutation)
-             {
-             case OPND_RM_PRE_DEC:
-               fmt = "-%s";
-               break;
-             case OPND_RM_PRE_INC:
-               fmt = "+%s";
-               break;
-             case OPND_RM_POST_DEC:
-               fmt = "%s-";
-               break;
-             case OPND_RM_POST_INC:
-               fmt = "%s+";
-               break;
-             case OPND_RM_NONE:
-             default:
-               fmt = "%s";
-               break;
-             }
-            (*info->fprintf_func) (info->stream, fmt,
-                                  registers[mo->regs[0]].name);
-            used_reg = 1;
-          }
+       const char *fmt;
+       assert (mo->mutation == OPND_RM_NONE || mo->n_regs == 1);
+       switch (mo->mutation)
+         {
+         case OPND_RM_PRE_DEC:
+           fmt = "-%s";
+           break;
+         case OPND_RM_PRE_INC:
+           fmt = "+%s";
+           break;
+         case OPND_RM_POST_DEC:
+           fmt = "%s-";
+           break;
+         case OPND_RM_POST_INC:
+           fmt = "%s+";
+           break;
+         case OPND_RM_NONE:
+         default:
+           if (mo->n_regs < 2)
+             (*info->fprintf_func) (info->stream, (mo->n_regs == 0) ? "%d" : "%d,", mo->base_offset);
+           fmt = "%s";
+           break;
+         }
+       if (mo->n_regs > 0)
+         (*info->fprintf_func) (info->stream, fmt,
+                                registers[mo->regs[0]].name);
+       used_reg = 1;
 
         if (mo->n_regs > used_reg)
           {
@@ -354,7 +351,7 @@ print_insn_s12z (bfd_vma memaddr, struct disassemble_info* info)
                 (struct mem_read_abstraction_base *) &mra);
 
   (info->fprintf_func) (info->stream, "%s", mnemonics[(long)operator]);
-  
+
   /* Ship out size sufficies for those instructions which
      need them.  */
   if (osize == -1)
@@ -362,7 +359,7 @@ print_insn_s12z (bfd_vma memaddr, struct disassemble_info* info)
       bool suffix = false;
       for (o = 0; o < n_operands; ++o)
        {
-         if (operands[o]->osize != -1)
+         if (operands[o] && operands[o]->osize != -1)
            {
              if (!suffix)
                {
This page took 0.023266 seconds and 4 git commands to generate.