Previous 199869 Revisions Next

r33929 Tuesday 16th December, 2014 at 15:58:12 UTC by David Haywood
more LIMM fixes (nw)
[src/emu/cpu/arcompact]arcompactdasm_ops.c

trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
r242440r242441
360360
361361      if ((breg == LIMM_REG) && (c != LIMM_REG))
362362      {
363         print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[breg], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
363         print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[c], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
364364      }
365365      else if ((c == LIMM_REG) && (breg != LIMM_REG))
366366      {
r242440r242441
467467int arcompact_handle03_dasm(DASM_OPS_32)
468468{
469469   int size = 4;
470   UINT32 limm = 0;
471   int got_limm = 0;
470472   // bitpos
471473   // 1111 1111 1111 1111 0000 0000 0000 0000
472474   // fedc ba98 7654 3210 fedc ba98 7654 3210
r242440r242441
484486   int D = (op & 0x00000020) >> 5; op &= ~0x00000020;
485487   int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0;
486488   
487   UINT32 limm = 0;
488489   if (breg == LIMM_REG)
489490   {
490491      GET_LIMM_32;
491492      size = 8;
493      got_limm = 1;
492494   }
493495
494496
r242440r242441
504506   output  += sprintf( output, "%03x", sdat);
505507   output  += sprintf( output, "] <- ");
506508
507   output  += sprintf( output, "%s", regnames[C]);
509   if (C == LIMM_REG)
510   {
511      if (!got_limm)
512      {
513         GET_LIMM_32;
514         size = 8;
515      }
516      output += sprintf(output, "(%08x)", limm);
508517
518   }
519   else
520   {
521      output += sprintf(output, "%s", regnames[C]);
522   }
523
509524   if (R) output  += sprintf( output, "(reserved bit set)");
510525
511526
r242440r242441
567582         }
568583
569584         output  += sprintf( output, "(%08x) ", limm );
570         if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);
585         if (ignore_dst == 0)
586         {
587            if (A != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[A]);
588            else output += sprintf(output, "<no dst>");
589         }
571590         else
572591         {
573            if (A) output += sprintf(output, "unused(%s)", regnames[A]);
592            if (ignore_dst == 1) { if (A) output += sprintf(output, "unused(%s)", regnames[A]); }
593            else { if (A != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[A]); } // mul operations expect A to be set to LIMM (no output)
574594         }
575595      }
576596      else
577597      {
578598         output  += sprintf( output, "C(%s) ", regnames[C]);
579         if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);
599         if (ignore_dst == 0)
600         {
601            if (A != LIMM_REG)  output += sprintf(output, "DST(%s)", regnames[A]);
602            else output += sprintf(output, "<no dst>");
603         }
580604         else
581605         {
582            if (A) output += sprintf(output, "unused(%s)", regnames[A]);
606            if (ignore_dst == 1) { if (A) output += sprintf(output, "unused(%s)", regnames[A]); }
607            else { if (A != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[A]); } // mul operations expect A to be set to LIMM (no output)
583608         }
584609
585610      }
r242440r242441
591616      int A = (op & 0x0000003f) >> 0; op &= ~0x0000003f;
592617
593618      output  += sprintf( output, "U(%02x) ", U );
594      if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);         
619      if (ignore_dst == 0)
620      {
621         if (A != LIMM_REG)  output += sprintf(output, "DST(%s)", regnames[A]);
622         else output += sprintf(output, "<no dst>");
623      }
595624      else
596625      {
597         if (A) output += sprintf(output, "unused(%s)", regnames[A]);
626         if (ignore_dst == 1) { if (A) output += sprintf(output, "unused(%s)", regnames[A]); }
627         else { if (A != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[A]); } // mul operations expect A to be set to LIMM (no output)
598628      }
599629   }
600630   else if (p == 2)
r242440r242441
608638      int M = (op & 0x00000020) >> 5; op &= ~0x00000020;
609639      int Q = (op & 0x0000001f) >> 0; op &= ~0x0000001f;
610640   
641
611642      output  += sprintf( output, " M(%d)", M);
612643      output  += sprintf( output, " Cond<%s> ", conditions[Q]);
613644
614645      if (M == 0)
615646      {
616647         int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0;
617         output  += sprintf( output, "C(%s)", regnames[C]);
648         
649         if (C == LIMM_REG)
650         {
651            if (!got_limm)
652            {
653               GET_LIMM_32;
654               size = 8;
655            }
656            output += sprintf(output, "(%08x)", limm);
657         }
658         else
659         {
660            output += sprintf(output, "C(%s)", regnames[C]);
661         }
618662
619663      }
620664      else if (M == 1)
r242440r242441
9721016int arcompact_handle05_01_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "LSR", 0,0); }
9731017int arcompact_handle05_02_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "ASR", 0,0); }
9741018int arcompact_handle05_03_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "ROR", 0,0); }
975int arcompact_handle05_04_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MUL64", 0,0); } // special
976int arcompact_handle05_05_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MULU64", 0,0);} // special
1019int arcompact_handle05_04_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MUL64", 2,0); } // special
1020int arcompact_handle05_05_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "MULU64", 2,0);} // special
9771021int arcompact_handle05_06_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "ADDS", 0,0); }
9781022int arcompact_handle05_07_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "SUBS", 0,0); }
9791023int arcompact_handle05_08_dasm(DASM_OPS_32)  { return arcompact_handle04_helper_dasm(DASM_PARAMS, "DIVAW", 0,0); }


Previous 199869 Revisions Next


© 1997-2024 The MAME Team