MCPcopy Create free account
hub / github.com/aldelaro5/dolphin-memory-engine / Opcode16Handler

Method Opcode16Handler

Source/Common/PPC/PowerPCDisassembler.cpp:581–696  ·  view source on GitHub ↗

handles all for opcode 16

Source from the content-addressed store, hash-verified

579
580// handles all for opcode 16
581std::string PowerPCDisassembler::Opcode16Handler(u32 binary, u32 current_instruction_address)
582{
583 static const char* opcode_16_bo_4[] = {"ge", "le", "ne", "ns"};
584 static const char* opcode_16_bo_12[] = {"lt", "gt", "eq", "so"};
585
586 u32 bo = ValueAtBits(binary, 6, 5);
587 u32 bi = ValueAtBits(binary, 11, 5);
588 u32 bd = ValueAtBits(binary, 16, 14) << 2;
589 u32 aa = ValueAtBits(binary, 30, 1);
590 u32 lk = ValueAtBits(binary, 31, 1);
591 bool show_bi = true;
592 bool hide_crf = false;
593 bool do_signs = true;
594
595 std::string mnemonic = "b";
596 switch (bo)
597 {
598 case 0:
599 case 1:
600 mnemonic += "dnzf";
601 break;
602 case 2:
603 case 3:
604 mnemonic += "dzf";
605 break;
606 case 4:
607 case 5:
608 case 6:
609 case 7:
610 show_bi = false;
611 mnemonic += opcode_16_bo_4[bi & 3];
612 break;
613 case 8:
614 case 9:
615 mnemonic += "dnzt";
616 break;
617 case 10:
618 case 11:
619 mnemonic += "dzt";
620 break;
621 case 12:
622 case 13:
623 case 14:
624 case 15:
625 show_bi = false;
626 mnemonic += opcode_16_bo_12[bi & 3];
627 break;
628 case 16:
629 case 17:
630 case 24:
631 case 25:
632 mnemonic += "dnz";
633 show_bi = false;
634 hide_crf = true;
635 break;
636 case 18:
637 case 19:
638 case 26:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected