示例#1
0
        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));
        }
示例#2
0
 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;
 }
示例#3
0
 public InstInfo(uint Mask, uint Value, InstInterp.InterpretOpcode Interpret)
 {
     this.Mask      = Mask;
     this.Value     = Value;
     this.Interpret = Interpret;
 }