Beispiel #1
0
            public override PowerPcInstruction Decode(uint wInstr, PowerPcDisassembler dasm)
            {
                var ops = new List <MachineOperand> {
                    dasm.RegFromBits(wInstr >> 21)
                };
                var      spr = ((wInstr >> 16) & 0x1F) | ((wInstr >> 6) & 0x3E0);
                Mnemonic mnemonic;

                switch (spr)
                {
                case 0x08: mnemonic = to ? Mnemonic.mtlr : Mnemonic.mflr; break;

                case 0x09: mnemonic = to ? Mnemonic.mtctr : Mnemonic.mfctr; break;

                default:
                    mnemonic = to ? Mnemonic.mtspr : Mnemonic.mfspr;
                    ops.Insert(0, ImmediateOperand.UInt32(spr));
                    break;
                }
                return(new PowerPcInstruction(mnemonic)
                {
                    InstructionClass = InstrClass.Linear,
                    Operands = ops.ToArray()
                });
            }
Beispiel #2
0
            public override PowerPcInstruction Decode(uint wInstr, PowerPcDisassembler dasm)
            {
                var reg = dasm.RegFromBits(wInstr >> 21);
                var spr = (wInstr >> 11) & 0x3FF;

                return(new PowerPcInstruction(mnemonic)
                {
                    InstructionClass = base.iclass,
                    Operands = new MachineOperand[] {
                        reg,
                        new ImmediateOperand(Constant.Word16((ushort)spr))
                    }
                });
            }