Previous 199869 Revisions Next

r33928 Tuesday 16th December, 2014 at 14:37:40 UTC by David Haywood
arcompact - fix some limm decoding, confirm that leapster CPU type uses the extended registers for multiply results (nw)
[src/emu/cpu/arcompact]arcompactdasm_ops.c

trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
r242439r242440
184184   /* 36 */ "r54(ext)",
185185   /* 37 */ "r55(ext)",
186186   /* 38 */ "r56(ext)",
187   /* 39 */ "r57(ext)", // MLO  (result registers for optional multply functions)
188   /* 3a */ "r58(ext)", // MMID
189   /* 3b */ "r59(ext)", // MHI
187   /* 39 */ "r57(M-LO)",  // MLO  (result registers for optional multply functions)
188   /* 3a */ "r58(M-MID)", // MMID
189   /* 3b */ "r59(M-HI)",  // MHI
190190   /* 3c */ "r60(LP_COUNT)",
191191   /* 3d */ "r61(reserved)",
192192   /* 3e */ "r62(LIMM)", // use Long Immediate Data instead of register
r242439r242440
207207    h |= ((op & 0x00e0) >> 5); \
208208   op &= ~0x00e7; \
209209
210#define COMMON32_GET_breg \
211   int b_temp = (op & 0x07000000) >> 24; op &= ~0x07000000; \
212   int B_temp = (op & 0x00007000) >> 12; op &= ~0x00007000; \
213   int breg = b_temp | (B_temp << 3); \
214
210215#define COMMON16_GET_breg \
211216   breg =  ((op & 0x0700) >>8); \
212217   op &= ~0x0700; \
r242439r242440
338343
339344
340345   int c = (op & 0x00000fc0) >> 6;
341   int b = (op & 0x07000000) >> 24;
342   b |= ((op & 0x00007000) >> 12) << 3;
346   COMMON32_GET_breg;
343347   int n = (op & 0x00000020) >> 5; op &= ~0x00000020;
344348
345349   op &= ~0x07007fe0;
346350
347   if ((b != LIMM_REG) && (c != LIMM_REG))
351   if ((breg != LIMM_REG) && (c != LIMM_REG))
348352   {
349      print("%s%s %s, %s %08x (%08x)", optext, delaybit[n], regnames[b], regnames[c], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
353      print("%s%s %s, %s %08x (%08x)", optext, delaybit[n], regnames[breg], regnames[c], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
350354   }
351355   else
352356   {
r242439r242440
354358      GET_LIMM_32;
355359      size = 8;
356360
357      if ((b == LIMM_REG) && (c != LIMM_REG))
361      if ((breg == LIMM_REG) && (c != LIMM_REG))
358362      {
359         print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[b], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
363         print("%s%s (%08x) %s %08x (%08x)", optext, delaybit[n], limm, regnames[breg], PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
360364      }
361      else if ((c == LIMM_REG) && (b != LIMM_REG))
365      else if ((c == LIMM_REG) && (breg != LIMM_REG))
362366      {
363         print("%s%s %s, (%08x) %08x (%08x)", optext, delaybit[n], regnames[b], limm, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
367         print("%s%s %s, (%08x) %08x (%08x)", optext, delaybit[n], regnames[breg], limm, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
364368      }
365369      else
366370      {
r242439r242440
396400   GET_01_01_01_BRANCH_ADDR
397401
398402   int u = (op & 0x00000fc0) >> 6;
399   int b = (op & 0x07000000) >> 24;
400   b |= ((op & 0x00007000) >> 12) << 3;
403   COMMON32_GET_breg;
401404   int n = (op & 0x00000020) >> 5; op &= ~0x00000020;
402405
403406   op &= ~0x07007fe0;
404407
405   print("%s%s %s, 0x%02x %08x (%08x)", optext, delaybit[n], regnames[b], u, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
408   print("%s%s %s, 0x%02x %08x (%08x)", optext, delaybit[n], regnames[breg], u, PC_ALIGNED32 + (address * 2), op & ~0xf8fe800f);
406409   
407410   return size;
408411}
r242439r242440
432435   int Z = (op & 0x00000180) >> 7;  //op &= ~0x00000180;
433436   int a = (op & 0x00000600) >> 9;  //op &= ~0x00000600;
434437   int D = (op & 0x00000800) >> 11;// op &= ~0x00000800;
435   int B = (op & 0x00007000) >> 12;// op &= ~0x00007000;
436438   int S = (op & 0x00008000) >> 15;// op &= ~0x00008000;
437439   int s = (op & 0x00ff0000) >> 16;// op &= ~0x00ff0000;
438   int b = (op & 0x07000000) >> 24;// op &= ~0x07000000;
440   COMMON32_GET_breg;
439441
440   int breg = b | (B << 3);
441442   int sdat = s | (S << 8); // todo - signed
442443
443444   UINT32 limm = 0;
r242439r242440
471472   // fedc ba98 7654 3210 fedc ba98 7654 3210
472473   // fields
473474   // 0001 1bbb ssss ssss SBBB CCCC CCDa aZZR
474   int B = (op & 0x00007000) >> 12;// op &= ~0x00007000;
475475   int S = (op & 0x00008000) >> 15;// op &= ~0x00008000;
476476   int s = (op & 0x00ff0000) >> 16;// op &= ~0x00ff0000;
477   int b = (op & 0x07000000) >> 24;// op &= ~0x07000000;
478477
479   int breg = b | (B << 3);
478   COMMON32_GET_breg;
480479   int sdat = s | (S << 8); // todo - signed
481480
482481   int R = (op & 0x00000001) >> 0; op &= ~0x00000001;
r242439r242440
519518   //           PP
520519   // 0010 0bbb 00ii iiii FBBB CCCC CCAA AAAA
521520   int size = 4;
521   UINT32 limm = 0;
522   int got_limm = 0;
522523
523524   int p = (op & 0x00c00000) >> 22; op &= ~0x00c00000;
524   int b = (op & 0x07000000) >> 24; op &= ~0x07000000;
525   int B = (op & 0x00007000) >> 12; op &= ~0x00007000;
526   int breg = b | (B << 3);
527   int F = (op & 0x00008000) >> 15;op &= ~0x00008000;
525   COMMON32_GET_breg;
526   int F = (op & 0x00008000) >> 15; op &= ~0x00008000;
528527
529528   output  += sprintf( output, "%s", optext);
530529   output  += sprintf( output, "%s", flagbit[F]);
r242439r242440
533532   
534533   if (!b_reserved)
535534   {
536      output += sprintf(output, " %s, ", regnames[breg]);
535      if (breg == LIMM_REG)
536      {
537         GET_LIMM_32;
538         size = 8;
539         got_limm = 1;
540         output  += sprintf( output, "(%08x) ", limm );
541
542      }
543      else
544      {
545         output += sprintf(output, " %s, ", regnames[breg]);
546      }
537547   }
538548   else
539549   {
r242439r242440
550560
551561      if (C == LIMM_REG)
552562      {
553         UINT32 limm;
554         GET_LIMM_32;
555         size = 8;   
563         if (!got_limm)
564         {
565            GET_LIMM_32;
566            size = 8;
567         }
568
556569         output  += sprintf( output, "(%08x) ", limm );
557570         if (!ignore_dst) output  += sprintf( output, "DST(%s)", regnames[A]);
558571         else
r242439r242440
807820   int size = 4;
808821
809822   int p = (op & 0x00c00000) >> 22; op &= ~0x00c00000;
810   int b = (op & 0x07000000) >> 24; op &= ~0x07000000;
811   int B = (op & 0x00007000) >> 12; op &= ~0x00007000;
812   int breg = b | (B << 3);
813   int F = (op & 0x00008000) >> 15;op &= ~0x00008000;
823   COMMON32_GET_breg;
824   int F = (op & 0x00008000) >> 15; op &= ~0x00008000;
814825
815826   output  += sprintf( output, "%s", optext);
816827   output  += sprintf( output, "%s", flagbit[F]);
r242439r242440
888899int arcompact_handle04_3x_helper_dasm(DASM_OPS_32, int dsize, int extend)
889900{
890901   int size = 4;
902   UINT32 limm;
903   int got_limm = 0;
904
891905   output += sprintf(output, "LD");
892906   output += sprintf(output, "%s", datasize[dsize]);
893907   output += sprintf(output, "%s", dataextend[extend]);
894908
895909   int mode = (op & 0x00c00000) >> 22; op &= ~0x00c00000;
896   int b = (op & 0x07000000) >> 24; op &= ~0x07000000;
897   int B = (op & 0x00007000) >> 12; op &= ~0x00007000;
898   int breg = b | (B << 3);
899   int D = (op & 0x00008000) >> 15;op &= ~0x00008000;
910   COMMON32_GET_breg;
911   int D = (op & 0x00008000) >> 15; op &= ~0x00008000;
900912   int C = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0;
901913   int A = (op & 0x0000003f) >> 0; op &= ~0x0000003f;
902914
903915   output += sprintf(output, "%s", addressmode[mode]);
904916   output += sprintf(output, "%s", cachebit[D]);
905917
906   output  += sprintf( output, "DST(%s)", regnames[A]);
907   output  += sprintf( output, "SRC1(%s)", regnames[breg]);
908   output  += sprintf( output, "SRC2(%s)", regnames[C]);
918   output  += sprintf( output, " %s. ", regnames[A]);
909919
910   
920   if (breg == LIMM_REG)
921   {
922      GET_LIMM_32;
923      size = 8;
924      got_limm = 1;
925      output  += sprintf( output, "[%08x, ", limm );
911926
927   }
928   else
929   {
930      output += sprintf(output, "[%s, ", regnames[breg]);
931   }
912932
933   if (C == LIMM_REG)
934   {
935      if (!got_limm)
936      {
937         GET_LIMM_32;
938         size = 8;
939      }
940      output  += sprintf( output, "(%08x)]", limm );
941
942   }
943   else
944   {
945      output  += sprintf( output, "%s]", regnames[C]);
946   }   
947
948
913949   return size;
914950   
915951
r242439r242440
963999   int size = 4;
9641000
9651001   int p = (op & 0x00c00000) >> 22; op &= ~0x00c00000;
966   int b = (op & 0x07000000) >> 24; op &= ~0x07000000;
967   int B = (op & 0x00007000) >> 12; op &= ~0x00007000;
968   int breg = b | (B << 3);
1002   COMMON32_GET_breg;
9691003   int F = (op & 0x00008000) >> 15;op &= ~0x00008000;
9701004
9711005   output  += sprintf( output, "%s", optext);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team