Esempio n. 1
0
 static void Main(string[] args)
 {
     List<String> HexCode;
     List<picWord> RAM;
     Init();
     if (args.Length<1)
         HexCode = readHex("flash.hex");
     else
         HexCode = readHex(args[0]);
     //NoLines = HexCode.Length;
     RAM = decompile(HexCode);
     RAM.Sort();
     foreach (var line in RAM)
         Console.WriteLine(line.ToString()); // Display the memory mapped dissasembly + data
     Console.ReadKey();
     PIC test = new PIC("lab11.hex");
     Console.ReadKey();
 }
Esempio n. 2
-26
        private void MenuItem_Open_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.DefaultExt = ".hex";
            ofd.Filter = "HEX Files (*.hex)|*.hex|All Files (*.*)|*.*";
            Nullable<bool> selected = ofd.ShowDialog();

            if(selected==true)
            {
                //lstISA.Items.Clear();
                lstHex.Items.Clear();
                string fname = ofd.FileName;
                StreamReader sr = new StreamReader(ofd.OpenFile());
                while(!sr.EndOfStream)
                    lstHex.Items.Add(sr.ReadLine());
                pic = new PIC(fname);
                ISA = pic.decompile();
                lstISA.ItemsSource = ISA;
                //foreach (var x in ISA)
                //{
                //    lstISA.Items.Add(x);
                //}
                mnuRun.IsEnabled = true;
                CLK.Interval = pic.getclkInterval()/2;
                CLK.Elapsed += CLK_Elapsed;
                CLK.AutoReset = true;
                lblStatus.DataContext = pic.getCurrent();
            }
        }