trunk/src/emu/cpu/arcompact/arcompactdasm_ops.c
| r242357 | r242358 | |
| 386 | 386 | return 4; |
| 387 | 387 | } |
| 388 | 388 | |
| 389 | | int arcompact_handle04_00_dasm(DASM_OPS_32) { print("ADD (%08x)", op); return 4;} |
| 390 | | int arcompact_handle04_01_dasm(DASM_OPS_32) { print("ADC (%08x)", op); return 4;} |
| 391 | | int arcompact_handle04_02_dasm(DASM_OPS_32) { print("SUB (%08x)", op); return 4;} |
| 392 | | int arcompact_handle04_03_dasm(DASM_OPS_32) { print("SBC (%08x)", op); return 4;} |
| 393 | | int arcompact_handle04_04_dasm(DASM_OPS_32) { print("AND (%08x)", op); return 4;} |
| 394 | | int arcompact_handle04_05_dasm(DASM_OPS_32) { print("OR (%08x)", op); return 4;} |
| 395 | | int arcompact_handle04_06_dasm(DASM_OPS_32) { print("BIC (%08x)", op); return 4;} |
| 396 | | int arcompact_handle04_07_dasm(DASM_OPS_32) { print("XOR (%08x)", op); return 4;} |
| 397 | | int arcompact_handle04_08_dasm(DASM_OPS_32) { print("MAX (%08x)", op); return 4;} |
| 398 | | int arcompact_handle04_09_dasm(DASM_OPS_32) { print("MIN (%08x)", op); return 4;} |
| 399 | 389 | |
| 400 | | int arcompact_handle04_0a_dasm(DASM_OPS_32) |
| 390 | int arcompact_handle04_helper_dasm(char *output, offs_t pc, UINT32 op, const UINT8* oprom, const char* optext, int ignore_dst) |
| 401 | 391 | { |
| 402 | 392 | // PP |
| 403 | 393 | // 0010 0bbb 00ii iiii FBBB CCCC CCAA AAAA |
| r242357 | r242358 | |
| 409 | 399 | int breg = b | (B << 3); |
| 410 | 400 | int F = (op & 0x00008000) >> 15;op &= ~0x00008000; |
| 411 | 401 | |
| 412 | | output += sprintf( output, "MOV"); |
| 402 | output += sprintf( output, "%s", optext); |
| 413 | 403 | output += sprintf( output, "%s", flagbit[F]); |
| 414 | 404 | output += sprintf( output, " p(%d)", p); |
| 415 | 405 | output += sprintf( output, " %s, ", regnames[breg]); |
| r242357 | r242358 | |
| 426 | 416 | UINT32 limm; |
| 427 | 417 | GET_LIMM_32; |
| 428 | 418 | size = 8; |
| 429 | | output += sprintf( output, "(%08x) A(%s)", limm, regnames[A]); |
| 419 | output += sprintf( output, "(%08x) ", limm ); |
| 420 | if (!ignore_dst) output += sprintf( output, "A(%s)", regnames[A]); |
| 421 | else output += sprintf( output, "unused(%s)", regnames[A]); |
| 430 | 422 | } |
| 431 | 423 | else |
| 432 | 424 | { |
| 433 | | output += sprintf( output, "C(%s) A(%s)", regnames[C], regnames[A]); |
| 425 | output += sprintf( output, "C(%s) ", regnames[C]); |
| 426 | if (!ignore_dst) output += sprintf( output, "A(%s)", regnames[A]); |
| 427 | else output += sprintf( output, "unused(%s)", regnames[A]); |
| 428 | |
| 434 | 429 | } |
| 435 | 430 | } |
| 436 | 431 | else if (p == 1) |
| r242357 | r242358 | |
| 439 | 434 | int U = (op & 0x00000fc0) >> 6; op &= ~0x00000fc0; |
| 440 | 435 | int A = (op & 0x0000003f) >> 0; op &= ~0x0000003f; |
| 441 | 436 | |
| 442 | | output += sprintf( output, "U(%02x) A(%s)", U, regnames[A]); |
| 443 | | |
| 437 | output += sprintf( output, "U(%02x) ", U ); |
| 438 | if (!ignore_dst) output += sprintf( output, "A(%s)", regnames[A]); |
| 439 | else output += sprintf( output, "unused(%s)", regnames[A]); |
| 444 | 440 | } |
| 445 | 441 | else if (p == 2) |
| 446 | 442 | { |
| r242357 | r242358 | |
| 474 | 470 | return size; |
| 475 | 471 | } |
| 476 | 472 | |
| 473 | int arcompact_handle04_00_dasm(DASM_OPS_32) |
| 474 | { |
| 475 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD", 0); |
| 476 | } |
| 477 | 477 | |
| 478 | | int arcompact_handle04_0b_dasm(DASM_OPS_32) { print("TST (%08x)", op); return 4;} |
| 479 | | int arcompact_handle04_0c_dasm(DASM_OPS_32) { print("CMP (%08x)", op); return 4;} |
| 480 | | int arcompact_handle04_0d_dasm(DASM_OPS_32) { print("RCMP (%08x)", op); return 4;} |
| 481 | | int arcompact_handle04_0e_dasm(DASM_OPS_32) { print("RSUB (%08x)", op); return 4;} |
| 482 | | int arcompact_handle04_0f_dasm(DASM_OPS_32) { print("BSET (%08x)", op); return 4;} |
| 483 | | int arcompact_handle04_10_dasm(DASM_OPS_32) { print("BCLR (%08x)", op); return 4;} |
| 484 | | int arcompact_handle04_11_dasm(DASM_OPS_32) { print("BTST (%08x)", op); return 4;} |
| 485 | | int arcompact_handle04_12_dasm(DASM_OPS_32) { print("BXOR (%08x)", op); return 4;} |
| 486 | | int arcompact_handle04_13_dasm(DASM_OPS_32) { print("BMSK (%08x)", op); return 4;} |
| 487 | | int arcompact_handle04_14_dasm(DASM_OPS_32) { print("ADD1 (%08x)", op); return 4;} |
| 488 | | int arcompact_handle04_15_dasm(DASM_OPS_32) { print("ADD2 (%08x)", op); return 4;} |
| 489 | | int arcompact_handle04_16_dasm(DASM_OPS_32) { print("ADD3 (%08x)", op); return 4;} |
| 490 | | int arcompact_handle04_17_dasm(DASM_OPS_32) { print("SUB1 (%08x)", op); return 4;} |
| 491 | | int arcompact_handle04_18_dasm(DASM_OPS_32) { print("SUB2 (%08x)", op); return 4;} |
| 492 | | int arcompact_handle04_19_dasm(DASM_OPS_32) { print("SUB3 (%08x)", op); return 4;} |
| 493 | | int arcompact_handle04_1a_dasm(DASM_OPS_32) { print("MPY (%08x)", op); return 4;} // * |
| 494 | | int arcompact_handle04_1b_dasm(DASM_OPS_32) { print("MPYH (%08x)", op); return 4;} // * |
| 495 | | int arcompact_handle04_1c_dasm(DASM_OPS_32) { print("MPYHU (%08x)", op); return 4;} // * |
| 496 | | int arcompact_handle04_1d_dasm(DASM_OPS_32) { print("MPYU (%08x)", op); return 4;} // * |
| 478 | int arcompact_handle04_01_dasm(DASM_OPS_32) |
| 479 | { |
| 480 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADC", 0); |
| 481 | } |
| 497 | 482 | |
| 483 | int arcompact_handle04_02_dasm(DASM_OPS_32) |
| 484 | { |
| 485 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB", 0); |
| 486 | } |
| 498 | 487 | |
| 488 | int arcompact_handle04_03_dasm(DASM_OPS_32) |
| 489 | { |
| 490 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SBC", 0); |
| 491 | } |
| 499 | 492 | |
| 493 | int arcompact_handle04_04_dasm(DASM_OPS_32) |
| 494 | { |
| 495 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "AND", 0); |
| 496 | } |
| 497 | |
| 498 | int arcompact_handle04_05_dasm(DASM_OPS_32) |
| 499 | { |
| 500 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "OR", 0); |
| 501 | } |
| 502 | |
| 503 | int arcompact_handle04_06_dasm(DASM_OPS_32) |
| 504 | { |
| 505 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BIC", 0); |
| 506 | } |
| 507 | |
| 508 | int arcompact_handle04_07_dasm(DASM_OPS_32) |
| 509 | { |
| 510 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "XOR", 0); |
| 511 | } |
| 512 | |
| 513 | int arcompact_handle04_08_dasm(DASM_OPS_32) |
| 514 | { |
| 515 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MAX", 0); |
| 516 | } |
| 517 | |
| 518 | int arcompact_handle04_09_dasm(DASM_OPS_32) |
| 519 | { |
| 520 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MIN", 0); |
| 521 | } |
| 522 | |
| 523 | |
| 524 | int arcompact_handle04_0a_dasm(DASM_OPS_32) |
| 525 | { |
| 526 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MOV", 1); |
| 527 | } |
| 528 | |
| 529 | int arcompact_handle04_0b_dasm(DASM_OPS_32) |
| 530 | { |
| 531 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "TST", 1); |
| 532 | } |
| 533 | |
| 534 | int arcompact_handle04_0c_dasm(DASM_OPS_32) |
| 535 | { |
| 536 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "CMP", 1); |
| 537 | } |
| 538 | |
| 539 | int arcompact_handle04_0d_dasm(DASM_OPS_32) |
| 540 | { |
| 541 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RCMP", 1); |
| 542 | } |
| 543 | |
| 544 | int arcompact_handle04_0e_dasm(DASM_OPS_32) |
| 545 | { |
| 546 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "RSUB", 0); |
| 547 | } |
| 548 | |
| 549 | int arcompact_handle04_0f_dasm(DASM_OPS_32) |
| 550 | { |
| 551 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BSET", 0); |
| 552 | } |
| 553 | |
| 554 | int arcompact_handle04_10_dasm(DASM_OPS_32) |
| 555 | { |
| 556 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BCLR", 0); |
| 557 | } |
| 558 | |
| 559 | int arcompact_handle04_11_dasm(DASM_OPS_32) |
| 560 | { |
| 561 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BTST", 0); |
| 562 | } |
| 563 | |
| 564 | int arcompact_handle04_12_dasm(DASM_OPS_32) |
| 565 | { |
| 566 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BXOR", 0); |
| 567 | } |
| 568 | |
| 569 | int arcompact_handle04_13_dasm(DASM_OPS_32) |
| 570 | { |
| 571 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "BMSK", 0); |
| 572 | } |
| 573 | |
| 574 | int arcompact_handle04_14_dasm(DASM_OPS_32) |
| 575 | { |
| 576 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD1", 0); |
| 577 | } |
| 578 | |
| 579 | int arcompact_handle04_15_dasm(DASM_OPS_32) |
| 580 | { |
| 581 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD2", 0); |
| 582 | } |
| 583 | |
| 584 | int arcompact_handle04_16_dasm(DASM_OPS_32) |
| 585 | { |
| 586 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "ADD3", 0); |
| 587 | } |
| 588 | |
| 589 | int arcompact_handle04_17_dasm(DASM_OPS_32) |
| 590 | { |
| 591 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB1", 0); |
| 592 | } |
| 593 | |
| 594 | int arcompact_handle04_18_dasm(DASM_OPS_32) |
| 595 | { |
| 596 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB2", 0); |
| 597 | } |
| 598 | |
| 599 | int arcompact_handle04_19_dasm(DASM_OPS_32) |
| 600 | { |
| 601 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "SUB3", 0); |
| 602 | } |
| 603 | |
| 604 | int arcompact_handle04_1a_dasm(DASM_OPS_32) |
| 605 | { |
| 606 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPY", 0); |
| 607 | } // * |
| 608 | |
| 609 | int arcompact_handle04_1b_dasm(DASM_OPS_32) |
| 610 | { |
| 611 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYH", 0); |
| 612 | } // * |
| 613 | |
| 614 | int arcompact_handle04_1c_dasm(DASM_OPS_32) |
| 615 | { |
| 616 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYHU", 0); |
| 617 | } // * |
| 618 | |
| 619 | int arcompact_handle04_1d_dasm(DASM_OPS_32) |
| 620 | { |
| 621 | return arcompact_handle04_helper_dasm(output, pc, op, oprom, "MPYU", 0); |
| 622 | } // * |
| 623 | |
| 624 | |
| 625 | |
| 500 | 626 | int arcompact_handle04_20_dasm(DASM_OPS_32) |
| 501 | 627 | { |
| 502 | 628 | // todo, other bits (in none long immediate mode at least) |