Beispiel #1
0
        // Constructor will read in the filepath and store the text in the file to a list.
        public Parser(string filepath)
        {
            filepath = filepath.Replace("\n", "");             // get rid of illegal character from file path

            var temp = System.IO.File.ReadAllLines(filepath);

            lines = new List <string>(temp);

            instRead = new InstructionReader();
            foreach (string line in lines)
            {
                if (line.Contains("DATA SEGMENT"))                 // stop printing at data section
                {
                    break;
                }

                instRead.ParseAndPrintInstruction(line);
            }
            MemoryInitializer.InitStaticData(lines);
            MemoryInitializer.InitStack();
            MemoryInitializer.InitTextData(lines);
        }