| 605 | } |
| 606 | |
| 607 | unsigned short X86CommonArchitecture::GetInstructionOpcode(const xed_decoded_inst_t* const xedd, const xed_operand_values_t* const ov, vector<InstructionTextToken>& result) const |
| 608 | { |
| 609 | string opcode = ""; |
| 610 | if (xed_decoded_inst_has_mpx_prefix(xedd)) |
| 611 | opcode += "BND "; |
| 612 | if (xed_decoded_inst_is_xacquire(xedd)) |
| 613 | opcode += "XACQUIRE "; |
| 614 | if (xed_decoded_inst_is_xrelease(xedd)) |
| 615 | opcode += "XRELEASE "; |
| 616 | if (xed_operand_values_has_lock_prefix(ov)) |
| 617 | opcode += "LOCK "; |
| 618 | if (xed_operand_values_has_real_rep(ov)) |
| 619 | { |
| 620 | if (xed_operand_values_has_rep_prefix(ov)) |
| 621 | opcode += "REP "; |
| 622 | if (xed_operand_values_has_repne_prefix(ov)) |
| 623 | opcode += "REPNE "; |
| 624 | } |
| 625 | else if (xed_operand_values_branch_not_taken_hint(ov)) |
| 626 | opcode += "HINT-NOT-TAKEN "; |
| 627 | else if (xed_operand_values_branch_taken_hint(ov)) |
| 628 | opcode += "HINT-TAKEN "; |
| 629 | |
| 630 | switch (m_disassembly_options.df) |
| 631 | { |
| 632 | case DF_INTEL: |
| 633 | opcode += string(xed_iform_to_iclass_string_intel(xed_decoded_inst_get_iform_enum(xedd))); |
| 634 | break; |
| 635 | case DF_BN_INTEL: |
| 636 | // To match asmx86 disassembly |
| 637 | switch (xed_decoded_inst_get_iclass(xedd)) |
| 638 | { |
| 639 | case XED_ICLASS_RET_NEAR: |
| 640 | opcode += "RETN"; |
| 641 | break; |
| 642 | case XED_ICLASS_JZ: |
| 643 | opcode += "JE"; |
| 644 | break; |
| 645 | case XED_ICLASS_JNZ: |
| 646 | opcode += "JNE"; |
| 647 | break; |
| 648 | case XED_ICLASS_JNB: |
| 649 | opcode += "JAE"; |
| 650 | break; |
| 651 | case XED_ICLASS_JNBE: |
| 652 | opcode += "JA"; |
| 653 | break; |
| 654 | case XED_ICLASS_JP: |
| 655 | opcode += "JPE"; |
| 656 | break; |
| 657 | case XED_ICLASS_JNP: |
| 658 | opcode += "JPO"; |
| 659 | break; |
| 660 | case XED_ICLASS_JNL: |
| 661 | opcode += "JGE"; |
| 662 | break; |
| 663 | case XED_ICLASS_JNLE: |
| 664 | opcode += "JG"; |