Esempio n. 1
0
        private bool openFile(string path)
        {
            if (!File.Exists(path))
            {
                MessageBox.Show(path + " does not exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(false);
            }

            // Parse instructions
            file = new AssemblyFile(path);

            // Initialize code textbox
            loadCodeText();

            // Initialize 'Start' menu
            loadStartMenu();

            // Update status
            setStatus("Successfully loaded " + path + " (" + file.Instructions.Count + " instructions)");
            return(true);
        }
Esempio n. 2
0
 public Simulator(AssemblyFile file, List <StackItem> initStack)
 {
     this.file      = file;
     this.Registers = new Registers();
     this.Stack     = new Stack(Registers, 1000 + getTotalSize(initStack), initStack); // return main will always be at 1000!
 }