Esempio n. 1
0
        static void Main(string[] args)
        {
            Vm vm = new Vm();

            vm.RegisterModule("$Sys", new SysModule(vm));

            ObjectFile f = ObjectFile.FromFile(@"C:\inferno\test.dis");
            Module     m = Module.FromObjectFile(vm, f);

            vm.StartMainThread(m);
            while (vm.Step())
            {
                ;
            }
        }
Esempio n. 2
0
        IModule GetModule(string path, ModuleImportDescriptor descriptor)
        {
            IModule result;

            if (!_loadedModules.TryGetValue(path, out result))
            {
                ObjectFile obj = ObjectFile.FromFile(path);
                if (obj == null)
                {
                    return(null);
                }

                result = Module.FromObjectFile(this, obj);
                _loadedModules[path] = result;
            }

            if (!result.ValidateImports(descriptor))
            {
                return(null);
            }

            return(result);
        }