private static void SetOpcode(string Encoding, InstInterp.InterpretOpcode Interpret, string FormattedASM = "", uint Cycles = 1) { uint Bit = (uint)Encoding.Length - 1; uint Value = 0; uint XMask = 0; for (int Index = 0; Index < Encoding.Length; ++Index, --Bit) { char Chr = Encoding.ToUpper()[Index]; if (Chr == '1') { Value |= (uint)(1 << (int)Bit); } else if (Chr == 'X') { XMask |= (uint)(1 << (int)Bit); } else if (Chr != '0') { throw new ArgumentException(nameof(Encoding)); } } XMask = ~XMask; AllInsts.Add(new InstInfo(XMask, Value, Interpret, FormattedASM, Cycles)); }
public InstInfo(uint Mask, uint Value, InstInterp.InterpretOpcode Interpret, string FormattedASM, uint Cycles) { this.Mask = Mask; this.Value = Value; this.Interpret = Interpret; this.FormattedASM = FormattedASM; this.Cycles = Cycles; }
public InstInfo(uint Mask, uint Value, InstInterp.InterpretOpcode Interpret) { this.Mask = Mask; this.Value = Value; this.Interpret = Interpret; }