상속: 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);
        }