示例#1
0
        private void ImportProgrameButton_Click(object sender, RoutedEventArgs e)
        {
            string programeFilePath;

            //select file saving path
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Text Files(*.txt)|*.txt|All Files(*.*)|*.*";
            DialogResult dialogResult = openFileDialog.ShowDialog();

            if (dialogResult == System.Windows.Forms.DialogResult.OK && openFileDialog.FileName != null)
            {
                programeFilePath             = openFileDialog.FileName;
                ProgrameFilePathTextBox.Text = programeFilePath;
            }
            else
            {
                return;
            }

            //load programe to ram
            LoadPrograme(programeFilePath);

            //initialize NextInstructionTextBlock
            NextInstructionTextBlock.Text = Decode(ram.Get4Bit(Convert.ToInt32(registers[32].Value)));
        }