//------------------------------------------------------------------------------------------------------------ private static void runProgramFromFile(string filename, bool debugging = false) { // Assume that each line of the program file contains a location and instruction eg. 01 +1009 try { string[] lines = File.ReadAllLines(filename); var vm = EPC.Make(debugging: debugging); var program = EPML.Make().FillTo(vm.MemoryLimit).Load(lines); Console.Clear(); vm.Run(program); } catch (IOException ex) { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } }
//------------------------------------------------------------------------------------------------------------ private static bool runPA06() { Console.WriteLine("\n**********************IS318-PA06********************\n"); var vm = EPC.Make(); var program = offerProgramChoices(); if (program != null) { vm.Run(program); } else { vm.Run(); } return(true); }