コード例 #1
0
        private void GUIUpdate()
        {
            if (UndoFlag)
            {
                return;
            }
            F_predPC_s        = F_predPC.ToString("X16");
            CPI               = (CLOCK - 4 - PenaltyCnt > 0)?1.0 * (CLOCK - 4) / (CLOCK - 4 - PenaltyCnt):1.0;
            this.Finstr.Text  = (f_icode < FunctionCollection.Length && f_ifun < FunctionCollection[f_icode].Length) ? FunctionCollection[f_icode][f_ifun] : "UKI";
            this.DIinstr.Text = (f_icode < FunctionCollection.Length && f_ifun < FunctionCollection[f_icode].Length) ? FunctionCollection[f_icode][f_ifun] : "UKI";
            this.EIinstr.Text = (d_icode < FunctionCollection.Length && d_ifun < FunctionCollection[d_icode].Length) ? FunctionCollection[d_icode][d_ifun] : "UKI";
            this.DSinstr.Text = (D_icode < FunctionCollection.Length && D_ifun < FunctionCollection[D_icode].Length) ? FunctionCollection[D_icode][D_ifun] : "UKI";
            this.MIinstr.Text = (e_icode < FunctionCollection.Length && e_ifun < FunctionCollection[e_icode].Length) ? FunctionCollection[e_icode][e_ifun] : "UKI";
            this.ESinstr.Text = (E_icode < FunctionCollection.Length && E_ifun < FunctionCollection[E_icode].Length) ? FunctionCollection[E_icode][E_ifun] : "UKI";
            this.WIinstr.Text = (m_icode < FunctionCollection.Length && m_ifun < FunctionCollection[m_icode].Length) ? FunctionCollection[m_icode][m_ifun] : "UKI";
            this.MSinstr.Text = (M_icode < FunctionCollection.Length && M_ifun < FunctionCollection[M_icode].Length) ? FunctionCollection[M_icode][M_ifun] : "UKI";
            this.WSinstr.Text = (W_icode < FunctionCollection.Length && W_ifun < FunctionCollection[W_icode].Length) ? FunctionCollection[W_icode][W_ifun] : "UKI";
            ToggleButton[] registers = new ToggleButton[15] {
                Hrax, Hrcx, Hrdx, Hrbx, Hrsp, Hrbp, Hrsi, Hrdi, Hr8, Hr9, Hr10, Hr11, Hr12, Hr13, Hr14
            };
            for (int i = 0; i < 15; i++)
            {
                registers[i].Content = (RegisterValue[i]).ToString(XorD);
            }

            this.DSvalC.Text = D_valC.ToString(XorD);
            this.DSvalP.Text = D_valP.ToString(XorD);
            this.DIvalC.Text = f_valC.ToString(XorD);
            this.DIvalP.Text = f_valP.ToString(XorD);
            this.ESvalC.Text = E_valC.ToString(XorD);
            this.ESvalA.Text = E_valA.ToString(XorD);
            this.ESvalB.Text = E_valB.ToString(XorD);
            this.EIvalC.Text = d_valC.ToString(XorD);
            this.EIvalA.Text = d_valA.ToString(XorD);
            this.EIvalB.Text = d_valB.ToString(XorD);
            this.MSvalA.Text = M_valA.ToString(XorD);
            this.MSvalE.Text = M_valE.ToString(XorD);
            this.MIvalA.Text = e_valA.ToString(XorD);
            this.MIvalE.Text = e_valE.ToString(XorD);
            this.WSvalM.Text = W_valM.ToString(XorD);
            this.WSvalE.Text = W_valE.ToString(XorD);
            this.WIvalM.Text = m_valM.ToString(XorD);
            this.WIvalE.Text = m_valE.ToString(XorD);

            Bindings.Update();
            if (SourceIsLoaded && LineHash.Contains(F_predPC))
            {
                this.SourceListView.SelectedIndex = Convert.ToInt32(LineHash[F_predPC]);
                SourceListView.ScrollIntoView(SourceListView.SelectedItem);
            }
        }
コード例 #2
0
ファイル: Pipeline.cs プロジェクト: ooorin/Y86-Simulator
    void Decode()
    {
        d_stat  = D_stat;
        d_icode = D_icode;
        d_ifun  = D_ifun;
        d_valC  = D_valC;
        if (point == 0)
        {
            GameObject.Find("begin13").GetComponent <car13>().brun();
            GameObject.Find("begin14").GetComponent <car14>().brun();
            GameObject.Find("begin15").GetComponent <car15>().brun();
        }
        d_srcA = d_srcB = d_dstE = d_dstM = RNONE;
        if (D_icode == IRRMOVL || D_icode == IRMMOVL || D_icode == IOPL || D_icode == IPUSHL)
        {
            d_srcA = D_rA;
        }
        if (D_icode == IPOPL || D_icode == IRET)
        {
            d_srcA = RESP;
        }

        if (D_icode == IOPL || D_icode == IRMMOVL || D_icode == IMRMOVL)
        {
            d_srcB = D_rB;
        }
        if (D_icode == IPUSHL || D_icode == IPOPL || D_icode == ICALL || D_icode == IRET)
        {
            d_srcB = RESP;
        }

        if (D_icode == IRRMOVL || D_icode == IIRMOVL || D_icode == IOPL)
        {
            d_dstE = D_rB;
        }
        if (D_icode == IPUSHL || D_icode == IPOPL || D_icode == ICALL || D_icode == IRET)
        {
            d_dstE = RESP;
        }

        if (D_icode == IMRMOVL || D_icode == IPOPL)
        {
            d_dstM = D_rA;
        }
        if (point == 0)
        {
            GameObject.Find("begin20").GetComponent <car20>().brun();
        }
        if (D_icode == ICALL || D_icode == IJXX)
        {
            if (point == 0)
            {
                GameObject.Find("begin16").GetComponent <car16>().brun();
            }
            d_valA    = D_valP;
            D_write_A = "NULL";
        }
        else if (d_srcA == RNONE)
        {
            d_valA    = 0;
            D_write_A = "NULL";
        }
        else if (d_srcA == e_dstE)
        {
            if (point == 0)
            {
                GameObject.Find("begin19").GetComponent <car19>().brun();
                GameObject.Find("begin39").GetComponent <plane1>().brun();
            }
            d_valA    = e_valE;
            D_write_A = "valA <- e_valE = " + e_valE.ToString();
        }
        else if (d_srcA == m_dstM)
        {
            if (point == 0)
            {
                GameObject.Find("begin19").GetComponent <car19>().brun();
                GameObject.Find("begin42").GetComponent <plane4>().brun();
            }
            d_valA    = m_valM;
            D_write_A = "valA <- m_valM = " + m_valM.ToString();
        }
        else if (d_srcA == m_dstE)
        {
            if (point == 0)
            {
                GameObject.Find("begin19").GetComponent <car19>().brun();
                GameObject.Find("begin44").GetComponent <plane6>().brun();
            }
            d_valA    = M_valE;
            D_write_A = "valA <- m_valE = " + M_valE.ToString();
        }
        else if (d_srcA == w_dstM)
        {
            if (point == 0)
            {
                GameObject.Find("begin19").GetComponent <car19>().brun();
                GameObject.Find("begin42").GetComponent <plane4>().brun();
            }
            d_valA    = W_valM;
            D_write_A = "valA <- w_valM = " + W_valM.ToString();
        }
        else if (d_srcA == w_dstE)
        {
            if (point == 0)
            {
                GameObject.Find("begin19").GetComponent <car19>().brun();
                GameObject.Find("begin44").GetComponent <plane6>().brun();
            }
            d_valA    = W_valE;
            D_write_A = "valA <- w_valE = " + W_valE.ToString();
        }
        else
        {
            if (point == 0)
            {
                GameObject.Find("begin17").GetComponent <car17>().brun();
            }
            d_valA    = reg[d_srcA];
            D_write_A = "valA <- R[" + regwrite[d_srcA] + "] = " + d_valA.ToString();
        }
        if (point == 0)
        {
            GameObject.Find("begin21").GetComponent <car21>().brun();
        }
        if (d_srcB == RNONE)
        {
            d_valB    = 0;
            D_write_B = "NULL";
        }
        else if (d_srcB == e_dstE)
        {
            if (point == 0)
            {
                GameObject.Find("begin39").GetComponent <plane1>().brun();
            }
            d_valB    = e_valE;
            D_write_B = "valB <- e_valE = " + e_valE.ToString();
        }
        else if (d_srcB == m_dstM)
        {
            if (point == 0)
            {
                GameObject.Find("begin42").GetComponent <plane4>().brun();
            }
            d_valB    = m_valM;
            D_write_B = "valB <- m_valM = " + m_valM.ToString();
        }
        else if (d_srcB == m_dstE)
        {
            if (point == 0)
            {
                GameObject.Find("begin44").GetComponent <plane6>().brun();
            }
            d_valB    = m_valE;
            D_write_B = "valB <- m_valE = " + M_valE.ToString();
        }
        else if (d_srcB == w_dstM)
        {
            if (point == 0)
            {
                GameObject.Find("begin42").GetComponent <plane4>().brun();
            }
            d_valB    = w_valM;
            D_write_B = "valB <- w_valM = " + W_valM.ToString();
        }
        else if (d_srcB == w_dstE)
        {
            if (point == 0)
            {
                GameObject.Find("begin44").GetComponent <plane6>().brun();
            }
            d_valB    = w_valE;
            D_write_B = "valB <- w_valE = " + W_valE.ToString();
        }
        else
        {
            if (point == 0)
            {
                GameObject.Find("begin18").GetComponent <car18>().brun();
            }
            d_valB    = reg[d_srcB];
            D_write_B = "valB <- R[" + regwrite[d_srcB] + "] = " + d_valB.ToString();
        }
        //Debug.Log("d_dstE d_dstM " + d_dstE + " " + d_dstM);
    }