Пример #1
0
        private static Dictionary<string, OpCodeInfo> GetOpCodeInfos()
        {
            var infos = new OpCodeInfo[]
            {
                new OpCodeInfo(0, "push_1", 2, 1, new Push1()),
                new OpCodeInfo(1, "add_u1", 1, 0),
                new OpCodeInfo(2, "write_u1", 1, 0),
                new OpCodeInfo(3, "call", 2, 1, new Call()),
                new OpCodeInfo(4, "return", 1, 0)
            };

            //Put it into a dictionary
            return infos.ToDictionary(o => o.AssemblerKeyword, o => o);
        }
Пример #2
0
        public ParsedInstruction(SourceLine sourceLine, string[] arguments, OpCodeInfo opCodeInfo)
        {
            if(sourceLine == null)
                throw new ArgumentNullException("sourceLine");

            if (arguments == null)
                throw new ArgumentNullException("arguments");

            if (opCodeInfo == null)
                throw new ArgumentNullException("opCodeInfo");

            this.SourceLine = sourceLine;
            this.Arguments = arguments;
            this.OpCodeInfo = opCodeInfo;
        }