Previous 199869 Revisions Next

r34013 Monday 22nd December, 2014 at 14:28:27 UTC by David Haywood
(nw)
[src/emu/cpu/arcompact]arcompact.h arcompact_execute.c arcompactdasm_ops.c

trunk/src/emu/cpu/arcompact/arcompact.h
r242524r242525
146146   ARCOMPACT_RETTYPE arcompact_handle01_01_01_0f(OPS_32);
147147   ARCOMPACT_RETTYPE arcompact_handle02(OPS_32);
148148   ARCOMPACT_RETTYPE arcompact_handle03(OPS_32);
149   ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32);
149//   ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32);
150150   ARCOMPACT_RETTYPE arcompact_handle04_01(OPS_32);
151151   ARCOMPACT_RETTYPE arcompact_handle04_02(OPS_32);
152152   ARCOMPACT_RETTYPE arcompact_handle04_03(OPS_32);
r242524r242525
767767
768768   ARCOMPACT_RETTYPE get_insruction(OPS_32);
769769
770
771   ARCOMPACT_HANDLER04_TYPE_PM(04_20);
770   ARCOMPACT_HANDLER04_TYPE_PM(04_00);
772771   ARCOMPACT_HANDLER04_TYPE_PM(04_0a);
772   ARCOMPACT_HANDLER04_TYPE_PM(04_20);
773773
774
775774private:
776775   address_space_config m_program_config;
777776
trunk/src/emu/cpu/arcompact/arcompact_execute.c
r242524r242525
12881288      b = limm;
12891289   }
12901290
1291   // BRHS
1291   // BRHS"
12921292   if (b >= c) // check
12931293   {
12941294      // take jump
r242524r242525
15101510   return m_pc + (size>>0);
15111511}
15121512
1513ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00(OPS_32) 
1513
1514ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p00(OPS_32)
15141515{
1515   return arcompact_handle04_helper(PARAMS, opcodes_04[0x00], /*"ADD"*/ 0,0);
1516   int size = 4;
1517   UINT32 limm = 0;
1518   int got_limm = 0;
1519
1520   COMMON32_GET_breg;
1521   COMMON32_GET_F;
1522   COMMON32_GET_creg
1523   COMMON32_GET_areg
1524
1525   UINT32 b, c;
1526
1527   if (breg == LIMM_REG)
1528   {
1529      GET_LIMM_32;
1530      size = 8;
1531      got_limm = 1;
1532      b = limm;
1533   }
1534   else
1535   {
1536      b = m_regs[breg];
1537   }
1538
1539   if (creg == LIMM_REG)
1540   {
1541      if (!got_limm)
1542      {
1543         GET_LIMM_32;
1544         size = 8;
1545      }
1546      c = limm;
1547   }
1548   else
1549   {
1550      c = m_regs[creg];
1551   }
1552
1553   // todo: if areg = LIMM then there is no result (but since that register can never be read, I guess it doesn't matter if we store it there anyway?)
1554   m_regs[areg] = b + c;
1555
1556   if (F)
1557   {
1558      arcompact_fatal("arcompact_handle04_00_p00 (ADD) (F set)\n"); // not yet supported
1559   }
1560
1561   return m_pc + (size >> 0);
15161562}
15171563
1564ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p01(OPS_32)
1565{
1566   int size = 4;
1567   arcompact_fatal("arcompact_handle04_00_p01 (ADD)\n");
1568   return m_pc + (size >> 0);
1569}
1570
1571ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p10(OPS_32)
1572{
1573   int size = 4;
1574   arcompact_fatal("arcompact_handle04_00_p10 (ADD)\n");
1575   return m_pc + (size >> 0);
1576}
1577
1578ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p11_m0(OPS_32)
1579{
1580   int size = 4;
1581   arcompact_fatal("arcompact_handle04_00_p11_m0 (ADD)\n");
1582   return m_pc + (size >> 0);
1583}
1584
1585ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p11_m1(OPS_32)
1586{
1587   int size = 4;
1588   arcompact_fatal("arcompact_handle04_00_p11_m1 (ADD)\n");
1589   return m_pc + (size >> 0);
1590}
1591
1592
15181593ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32) 
15191594{
15201595   return arcompact_handle04_helper(PARAMS, opcodes_04[0x01], /*"ADC"*/ 0,0);
trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
r242524r242525
404404   //   output  += sprintf( output, " p(%d)", p);
405405
406406
407   if (!b_reserved)
407   if ((!b_reserved) && (breg == LIMM_REG))
408408   {
409      if (breg == LIMM_REG)
410      {
411         GET_LIMM_32;
412         size = 8;
413         got_limm = 1;
414         output += sprintf(output, " 0x%08x ", limm);
415
416      }
417      else
418      {
419         output += sprintf(output, " %s, ", regnames[breg]);
420      }
409      GET_LIMM_32;
410      size = 8;
411      got_limm = 1;
421412   }
422   else
423   {
424      if (breg) output += sprintf(output, "reserved(%s), ", regnames[breg]);
425   }
426413
427414   if (creg == LIMM_REG)
428415   {
r242524r242525
431418         GET_LIMM_32;
432419         size = 8;
433420      }
421   }
434422
435      output += sprintf(output, " 0x%08x ", limm);
436      if (ignore_dst == 0)
437      {
438         if (areg != LIMM_REG) output += sprintf(output, "DST(%s)", regnames[areg]);
439         else output += sprintf(output, "<no dst>");
440      }
423   // areg can be LIMM too, but in that case LIMM indicates 'no destination' rather than an actual LIMM value following
424
425   if (ignore_dst == 0)
426   {
427      if (areg != LIMM_REG)  output += sprintf(output, " %s <-", regnames[areg]);
428      else output += sprintf(output, " <no dst> <-");
429   }
430   else if (ignore_dst == 1) // certain opcode types ignore the 'a' field entirely, it should be set to 0.
431   {
432       if (areg) output += sprintf(output, " <reserved %d> <-", areg);
433   }
434   else if (ignore_dst == 2) // for multiply operations areg should always be set to LIMM
435   {
436      if (areg != LIMM_REG) output += sprintf(output, " <invalid %d> <-", areg);
437      else  output += sprintf(output, " <mulres> <-");
438   }
439
440   if (!b_reserved)
441   {
442      if (breg == LIMM_REG)
443         output += sprintf(output, " 0x%08x,", limm);
441444      else
442      {
443         if (ignore_dst == 1) { if (areg) output += sprintf(output, "unused(%s)", regnames[areg]); }
444         else
445         {
446            if (areg != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[areg]);
447            else  output += sprintf(output, "<mulres>");
448         } // mul operations expect A to be set to LIMM (no output)
449      }
445         output += sprintf(output, " %s,", regnames[breg]);
450446   }
451447   else
452448   {
453      output += sprintf(output, "C(%s) ", regnames[creg]);
454      if (ignore_dst == 0)
455      {
456         if (areg != LIMM_REG)  output += sprintf(output, "DST(%s)", regnames[areg]);
457         else output += sprintf(output, "<no dst>");
458      }
459      else
460      {
461         if (ignore_dst == 1) { if (areg) output += sprintf(output, "unused(%s)", regnames[areg]); }
462         else
463         {
464            if (areg != LIMM_REG) output += sprintf(output, "invalid(%s)", regnames[areg]);
465            else  output += sprintf(output, "<mulres>");
466         } // mul operations expect A to be set to LIMM (no output)
467      }
468
449      if (breg) output += sprintf(output, "<reserved %d>,", breg);
469450   }
451
452   if (creg == LIMM_REG)
453      output += sprintf(output, " 0x%08x", limm);
454   else
455      output += sprintf(output, " %s", regnames[creg]);
456
470457   return size;
471458}
472459


Previous 199869 Revisions Next


© 1997-2024 The MAME Team