Exemplo n.º 1
0
        static void Main(string[] args)
        {
            if(!Directory.Exists("tmp"))
            {
                Directory.CreateDirectory("tmp");
            }

            var c = new Compiler();
            var x = c.Asm(File.ReadAllText(args[0]));

            File.WriteAllText("tmp\\tmp.asm",Properties.Resources.Template.Replace("{main}", x));
            File.Delete(Path.GetFullPath(args[1]));
            RunNoWindow("nasm", "-f elf -o \"" + Path.GetFullPath("tmp\\tmp.o") + "\" \"" + Path.GetFullPath("tmp\\tmp.asm") + "\"");
            RunNoWindow("gcc", "-static -o \"" + Path.GetFullPath(args[1]) + "\" \"" + Path.GetFullPath("tmp\\tmp.o") + "\"");
            RunWindow(Path.GetFullPath(args[1]) , "");
        }
Exemplo n.º 2
0
 static void Main(string[] args)
 {
     var c = new Compiler();
     var x = c.Asm(Properties.Resources.TestCode);
 }