static void Main(string[] args) { if (args.Length != 1) { DisplayUsage(); return; } String filePath = args[0]; if (!File.Exists(filePath)) { Console.WriteLine("{0} not found", filePath); return; } // Load the source. Console.WriteLine(Strings.AppName); Console.WriteLine(); Console.WriteLine("Loading source ({0})", filePath); String[] sourceCodeLines = File.ReadAllLines(filePath); // Compile source. OISCAsm compiler = new OISCAsm(sourceCodeLines); byte[] compiledBytes = compiler.Assemble(); // Output compiled binary to file. String outputFilePath = GenerateOutputFilename(filePath); File.WriteAllBytes(outputFilePath, compiledBytes); }