// 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); }
// M - memory access: base + offset with 5-bit register encodings private static Mutator <MicroMipsDisassembler> M(PrimitiveType dt) { return((u, d) => { var iBase = (int)baseField.Read(u); var baseReg = d.arch.GetRegister(iBase); var offset = offsetField.ReadSigned(u); var mop = new IndirectOperand(dt, offset, baseReg); d.ops.Add(mop); return true; }); }
private static Mutator <MicroMipsDisassembler> m(PrimitiveType dt) { var baseField = new Bitfield(4, 3); var offsetField = new Bitfield(0, 4); return((u, d) => { var iBase = baseField.Read(u); var iBase32 = threeBitRegisterEncodings[iBase]; var baseReg = d.arch.GetRegister(iBase32); var offset = offsetField.ReadSigned(u) * dt.Size; var mop = new IndirectOperand(dt, offset, baseReg); d.ops.Add(mop); return true; }); }