public override MipsInstruction Decode(uint wInstr, MicroMipsDisassembler dasm) { if (!dasm.rdr.TryReadUInt16(out ushort uLow16Bits)) { return(dasm.CreateInvalidInstruction()); } uint uInstrNew = (wInstr << 16) | uLow16Bits; return(decoder.Decode(uInstrNew, dasm)); }
public override MipsInstruction Decode(uint wInstr, MicroMipsDisassembler dasm) { foreach (var mutator in mutators) { if (!mutator(wInstr, dasm)) { return(dasm.CreateInvalidInstruction()); } } var ops = dasm.ops; var instr = new MipsInstruction { Mnemonic = this.opcode, InstructionClass = this.iclass, Operands = ops.ToArray() }; ops.Clear(); return(instr); }
public override MipsInstruction Decode(uint wInstr, MicroMipsDisassembler dasm) { foreach (var mutator in mutators) { if (!mutator(wInstr, dasm)) { return(dasm.CreateInvalidInstruction()); } } var ops = dasm.ops; var instr = new MipsInstruction { opcode = this.opcode, InstructionClass = this.iclass, op1 = ops.Count > 0 ? ops[0] : null, op2 = ops.Count > 1 ? ops[1] : null, op3 = ops.Count > 2 ? ops[2] : null, op4 = ops.Count > 3 ? ops[3] : null, }; ops.Clear(); return(instr); }