public InstructionI(int opcode, CpuReg rs, CpuReg rt, int immediate) { OpCode = opcode; Rs = rs; Rt = rt; Immediate = immediate; }
public InstructionR(int opcode, CpuReg rs, CpuReg rt, CpuReg rd, int shamt, int funct) { OpCode = opcode; Rs = rs; Rt = rt; Rd = rd; Shamt = shamt; Funct = funct; }
public static InstructionI Emit(InstructionMnemonic mnemonic, CpuReg rs, CpuReg rt, int immediate) { var instruction = ISA.GetInstruction (mnemonic); if (instruction.Format != InstructionFormat.I) { throw new Exception ("Wrong instruction type."); } return new InstructionI { Instruction = instruction.Instruction, OpCode = instruction.OpCode, Rs = rs, Rt = rt, Immediate = immediate }; }
public static InstructionR Emit(InstructionMnemonic mnemonic, CpuReg rs, CpuReg rt, CpuReg rd, int shamt) { var instruction = ISA.GetInstruction (mnemonic); if (instruction.Format != InstructionFormat.R) { throw new Exception ("Wrong instruction type."); } return new InstructionR { Instruction = instruction.Instruction, OpCode = instruction.OpCode, Rs = rs, Rt = rt, Rd = rd, Shamt = shamt, Funct = instruction.Function }; }
public static InstructionI Emit(InstructionMnemonic mnemonic, CpuReg rs, CpuReg rt, int immediate) { var instruction = ISA.GetInstruction(mnemonic); if (instruction.Format != InstructionFormat.I) { throw new Exception("Wrong instruction type."); } return(new InstructionI { Instruction = instruction.Instruction, OpCode = instruction.OpCode, Rs = rs, Rt = rt, Immediate = immediate }); }
public static InstructionR Emit(InstructionMnemonic mnemonic, CpuReg rs, CpuReg rt, CpuReg rd, int shamt) { var instruction = ISA.GetInstruction(mnemonic); if (instruction.Format != InstructionFormat.R) { throw new Exception("Wrong instruction type."); } return(new InstructionR { Instruction = instruction.Instruction, OpCode = instruction.OpCode, Rs = rs, Rt = rt, Rd = rd, Shamt = shamt, Funct = instruction.Function }); }
static PropertyInfo GetPropertyInfo(CpuReg r) { var propertyInfo = typeof(CPU).GetProperty(r.ToString(), BindingFlags.Public | BindingFlags.Static); return(propertyInfo); }
public static void SetRegister(CpuReg r, int value) { var propertyInfo = GetPropertyInfo(r); propertyInfo.SetValue(null, value); }
public static int GetRegister(CpuReg r) { var propertyInfo = GetPropertyInfo(r); return((int)propertyInfo.GetValue(null, null)); }
static PropertyInfo GetPropertyInfo(CpuReg r) { var propertyInfo = typeof(CPU).GetProperty (r.ToString (), BindingFlags.Public | BindingFlags.Static); return propertyInfo; }
public static void SetRegister(CpuReg r, int value) { var propertyInfo = GetPropertyInfo (r); propertyInfo.SetValue (null, value); }
public static int GetRegister(CpuReg r) { var propertyInfo = GetPropertyInfo (r); return (int)propertyInfo.GetValue (null, null); }