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)); }
// m - memory access: base + offset with 3-bit register encoding private static bool mb(uint uInstr, MicroMipsDisassembler dasm) { var encodedBase = baseField16.Read(uInstr); var iBase = threeBitRegisterEncodings[encodedBase]; var baseReg = dasm.arch.GetRegister(iBase); var encOffset = offsetField16.Read(uInstr); var offset = encodedByteOffsets[encOffset]; var mop = new IndirectOperand(PrimitiveType.Byte, offset, baseReg); dasm.ops.Add(mop); return(true); }
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); }
private static bool Is64Bit(uint uInstr, MicroMipsDisassembler dasm) { return(dasm.arch.WordWidth.BitSize == 64); }