Inheritance: IAssembler
示例#1
0
文件: Program.cs 项目: Creou/OISCVM
        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);
        }
示例#2
0
        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);
        }