static void Main(string[] args)
        {
            AssemblerPass1 newAP1 = new AssemblerPass1();

            Console.WriteLine("Enter fileLocation: ");
            string fileLocation = Console.ReadLine();

            newAP1.FileLocation = fileLocation;

            newAP1.InitialiseAssemblerPass1();
            newAP1.printrfInstruction();
        }
Exemple #2
0
        private void CompileButton_Click(object sender, RoutedEventArgs e)
        {
            AssemblerPass1 newPass = new AssemblerPass1(FileLocation);

            int i = 1;

            foreach (var Line in newPass.replaceLabelInstr)
            {
                resolvedLineNumbers.AppendText(i.ToString());
                resolvedLineNumbers.AppendText(Environment.NewLine);

                resolvedLabelsNoWhiteSpace.AppendText(Line);
                resolvedLabelsNoWhiteSpace.AppendText(Environment.NewLine);
                i++;
            }
            string filepath3 = System.IO.Path.GetDirectoryName(FileLocation) + @"\" + System.IO.Path.GetFileNameWithoutExtension(FileLocation) + ".mac";

            foreach (var Line in File.ReadAllLines(filepath3))
            {
                MachineCodeTextBox.AppendText(Line);
                MachineCodeTextBox.AppendText(Environment.NewLine);
                //MachineCodeTextBox.AppendText(Environment.NewLine);
            }
        }