Example #1
0
    static public void Init_All()
    {
        Intl  = true;
        Clock = Nbub = 0;
        Program.Renew(Control.States.SAOK);
        Excute.Updata_CC(true, false, false);
        Fetch.Updata(0);
        Decode.Updata(Control.States.SAOK, Control.Codes.INOP, 0, Control.Registers.RNONE, Control.Registers.RNONE, 0, 0);
        Excute.Updata(Control.States.SAOK, Control.Codes.INOP, 0, 0, 0, 0, Control.Registers.RNONE, Control.Registers.RNONE, Control.Registers.RNONE, Control.Registers.RNONE);
        Memory.Updata(Control.States.SAOK, Control.Codes.INOP, 0, false, 0, 0, Control.Registers.RNONE, Control.Registers.RNONE);
        Write_back.Updata(Control.States.SAOK, Control.Codes.INOP, 0, 0, 0, Control.Registers.RNONE, Control.Registers.RNONE);
        Program.Renew(Control.States.SAOK);

        Decode.Init_Reg();
        Memory.Init_Mem();

        Run.ck = false;
        Read_ys.Init();

        Control.Init();
        BreakControl.Init();

        Display.nlog++;
        StreamWriter sw = new StreamWriter(@"./log.out", false);

        sw.Close();
//        print("?");
    }
Example #2
0
    static public void Work(string path)
    {
        if (!File.Exists(path))
        {
            GameObject.Find("Canvas/Button_Panel/Input_File").GetComponent <InputField>().text = "No Such File!";
            return;
        }
        int p = path.Length - 1;

        while (p >= 0 && path[p] == ' ')
        {
            p--;
        }
        if (path.Length <= 2 || (!(path[p] == 's' || path[p] == 'o') || path[p - 1] != 'y' || path[p - 2] != '.'))
        {
            GameObject.Find("Canvas/Button_Panel/Input_File").GetComponent <InputField>().text = "Invalid File!";
            return;
        }

        GameObject.Find("Canvas/Button_Panel/Input_File").GetComponent <InputField>().text = "Find the Target!";

        Updata.Init_All();
        Display.Show_Registers();
        if (path[p] == 's')
        {
            Read_ys.Work(path);
        }
        else
        {
            Read_yo.Work(path);
        }
    }