mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
32 lines
No EOL
801 B
C#
32 lines
No EOL
801 B
C#
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using Indy.IL2CPU;
|
|
using Indy.IL2CPU.IL.X86;
|
|
|
|
namespace IL2CPU {
|
|
public class Program {
|
|
public static void Main(string[] args) {
|
|
try {
|
|
string exeName = "HelloWorldMetal.exe";
|
|
if(args.Length ==1 ) {
|
|
exeName = args[0];
|
|
}
|
|
Engine e = new Engine();
|
|
e.DebugLog += delegate(string aMessage) {
|
|
Console.WriteLine(aMessage);
|
|
};
|
|
using (FileStream fs = new FileStream(@"output.asm", FileMode.Create)) {
|
|
using (StreamWriter br = new StreamWriter(fs)) {
|
|
e.Execute(exeName, TargetPlatformEnum.x86, br);
|
|
}
|
|
}
|
|
} catch (Exception E) {
|
|
Console.WriteLine(E.ToString());
|
|
}
|
|
Console.WriteLine("");
|
|
Console.WriteLine("Completed");
|
|
Console.ReadLine();
|
|
}
|
|
}
|
|
} |