trunk/src/emu/cpu/arcompact/arcompact.h
| r242524 | r242525 | |
| 146 | 146 | ARCOMPACT_RETTYPE arcompact_handle01_01_01_0f(OPS_32); |
| 147 | 147 | ARCOMPACT_RETTYPE arcompact_handle02(OPS_32); |
| 148 | 148 | ARCOMPACT_RETTYPE arcompact_handle03(OPS_32); |
| 149 | | ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32); |
| 149 | // ARCOMPACT_RETTYPE arcompact_handle04_00(OPS_32); |
| 150 | 150 | ARCOMPACT_RETTYPE arcompact_handle04_01(OPS_32); |
| 151 | 151 | ARCOMPACT_RETTYPE arcompact_handle04_02(OPS_32); |
| 152 | 152 | ARCOMPACT_RETTYPE arcompact_handle04_03(OPS_32); |
| r242524 | r242525 | |
| 767 | 767 | |
| 768 | 768 | ARCOMPACT_RETTYPE get_insruction(OPS_32); |
| 769 | 769 | |
| 770 | | |
| 771 | | ARCOMPACT_HANDLER04_TYPE_PM(04_20); |
| 770 | ARCOMPACT_HANDLER04_TYPE_PM(04_00); |
| 772 | 771 | ARCOMPACT_HANDLER04_TYPE_PM(04_0a); |
| 772 | ARCOMPACT_HANDLER04_TYPE_PM(04_20); |
| 773 | 773 | |
| 774 | | |
| 775 | 774 | private: |
| 776 | 775 | address_space_config m_program_config; |
| 777 | 776 | |
trunk/src/emu/cpu/arcompact/arcompact_execute.c
| r242524 | r242525 | |
| 1288 | 1288 | b = limm; |
| 1289 | 1289 | } |
| 1290 | 1290 | |
| 1291 | | // BRHS |
| 1291 | // BRHS" |
| 1292 | 1292 | if (b >= c) // check |
| 1293 | 1293 | { |
| 1294 | 1294 | // take jump |
| r242524 | r242525 | |
| 1510 | 1510 | return m_pc + (size>>0); |
| 1511 | 1511 | } |
| 1512 | 1512 | |
| 1513 | | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00(OPS_32) |
| 1513 | |
| 1514 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_00_p00(OPS_32) |
| 1514 | 1515 | { |
| 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); |
| 1516 | 1562 | } |
| 1517 | 1563 | |
| 1564 | ARCOMPACT_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 | |
| 1571 | ARCOMPACT_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 | |
| 1578 | ARCOMPACT_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 | |
| 1585 | ARCOMPACT_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 | |
| 1518 | 1593 | ARCOMPACT_RETTYPE arcompact_device::arcompact_handle04_01(OPS_32) |
| 1519 | 1594 | { |
| 1520 | 1595 | return arcompact_handle04_helper(PARAMS, opcodes_04[0x01], /*"ADC"*/ 0,0); |
trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242524 | r242525 | |
| 404 | 404 | // output += sprintf( output, " p(%d)", p); |
| 405 | 405 | |
| 406 | 406 | |
| 407 | | if (!b_reserved) |
| 407 | if ((!b_reserved) && (breg == LIMM_REG)) |
| 408 | 408 | { |
| 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; |
| 421 | 412 | } |
| 422 | | else |
| 423 | | { |
| 424 | | if (breg) output += sprintf(output, "reserved(%s), ", regnames[breg]); |
| 425 | | } |
| 426 | 413 | |
| 427 | 414 | if (creg == LIMM_REG) |
| 428 | 415 | { |
| r242524 | r242525 | |
| 431 | 418 | GET_LIMM_32; |
| 432 | 419 | size = 8; |
| 433 | 420 | } |
| 421 | } |
| 434 | 422 | |
| 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); |
| 441 | 444 | 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]); |
| 450 | 446 | } |
| 451 | 447 | else |
| 452 | 448 | { |
| 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); |
| 469 | 450 | } |
| 451 | |
| 452 | if (creg == LIMM_REG) |
| 453 | output += sprintf(output, " 0x%08x", limm); |
| 454 | else |
| 455 | output += sprintf(output, " %s", regnames[creg]); |
| 456 | |
| 470 | 457 | return size; |
| 471 | 458 | } |
| 472 | 459 | |