Пример #1
0
 static public void Updata(Control.States state, Control.Codes code, long ifun, Control.Registers rA, Control.Registers rB, long valC, long valP)
 {
     D_state = state;
     D_icode = code;
     D_ifun  = ifun;
     D_rA    = rA;
     D_rB    = rB;
     D_valC  = valC;
     D_valP  = valP;
 }
Пример #2
0
 static public void Updata(Control.States state, Control.Codes icode, long ifun, long valE, long valM, Control.Registers dstE, Control.Registers dstM)
 {
     W_state = state;
     W_icode = icode;
     W_ifun  = ifun;
     W_valE  = valE;
     W_valM  = valM;
     W_dstE  = dstE;
     W_dstM  = dstM;
 }
Пример #3
0
 static public void Updata(Control.States state, Control.Codes icode, long ifun, bool Cnd, long valE, long valA, Control.Registers dstE, Control.Registers dstM)
 {
     M_state = state;
     M_icode = icode;
     M_ifun  = ifun;
     M_Cnd   = Cnd;
     M_valE  = valE;
     M_valA  = valA;
     M_dstE  = dstE;
     M_dstM  = dstM;
 }
Пример #4
0
 static public void Updata(Control.States state, Control.Codes icode, long ifun, long valC, long valA, long valB, Control.Registers dstE, Control.Registers dstM, Control.Registers srcA, Control.Registers srcB)
 {
     E_state = state;
     E_icode = icode;
     E_ifun  = ifun;
     E_valC  = valC;
     E_valA  = valA;
     E_valB  = valB;
     E_dstE  = dstE;
     E_dstM  = dstM;
     E_srcA  = srcA;
     E_srcB  = srcB;
 }
Пример #5
0
 static string Get_State(Control.States st)
 {
     return(state[(long)st]);
 }
Пример #6
0
 static public void Renew(Control.States state_)
 {
     state = state_;
     return;
 }
Пример #7
0
    static public void Work()
    {
        long r0 = 0, r1 = 0;
        long valC = 0;

        f_PC = SelectPC();
        Read_b(ref r0, ref r1);
        f_icode = (Control.Codes)r0;
        f_ifun  = r1;

        r0      = r1 = 15;
        f_state = Control.States.SAOK;
        switch (f_icode)
        {
        case Control.Codes.IHALT: f_state = Control.States.SHLT; break;

        case Control.Codes.INOP: break;

        case Control.Codes.IRRMOVQ:
            Read_b(ref r0, ref r1);
            break;

        case Control.Codes.IIRMOVQ:
            Read_b(ref r0, ref r1);
            Read_d(ref valC);
            break;

        case Control.Codes.IRMMOVQ:
            Read_b(ref r0, ref r1);
            Read_d(ref valC);
            break;

        case Control.Codes.IMRMOVQ:
            Read_b(ref r0, ref r1);
            Read_d(ref valC);
            break;

        case Control.Codes.IOPQ:
            Read_b(ref r0, ref r1);
            break;

        case Control.Codes.IJXX:
            Read_d(ref valC);
            break;

        case Control.Codes.ICALL:
            Read_d(ref valC);
            break;

        case Control.Codes.IRET:
            break;

        case Control.Codes.IPUSHQ:
            Read_b(ref r0, ref r1);
            break;

        case Control.Codes.IPOPQ:
            Read_b(ref r0, ref r1);
            break;

        case Control.Codes.IIOPQ:
            Read_b(ref r0, ref r1);
            Read_d(ref valC);
            break;

        default:
            f_state = Control.States.SINS;
            f_icode = Control.Codes.IHALT;
            f_ifun  = 0;
            break;
        }
        f_rA   = (Control.Registers)r0;
        f_rB   = (Control.Registers)r1;
        f_valC = valC;

        f_valP   = f_PC;
        f_predPC = PredPC();

        if (f_icode != Control.Codes.IOPQ && f_icode != Control.Codes.IJXX && f_icode != Control.Codes.IRRMOVQ && f_icode != Control.Codes.IIOPQ)
        {
            if (f_ifun != 0)
            {
                f_state = Control.States.SINS;
            }
        }
        else
        {
            if ((f_icode == Control.Codes.IOPQ || f_icode == Control.Codes.IIOPQ) && f_ifun > 3)
            {
                f_state = Control.States.SINS;
            }
            else
            if (f_ifun > 6)
            {
                f_state = Control.States.SINS;
            }
        }
        if ((f_icode == Control.Codes.IRRMOVQ || f_icode == Control.Codes.IRMMOVQ || f_icode == Control.Codes.IMRMOVQ || f_icode == Control.Codes.IOPQ) && (f_rA == Control.Registers.RNONE || f_rB == Control.Registers.RNONE))
        {
            f_state = Control.States.SINS;
        }
        if ((f_icode == Control.Codes.IIRMOVQ || f_icode == Control.Codes.IIOPQ) && (f_rA != Control.Registers.RNONE || f_rB == Control.Registers.RNONE))
        {
            f_state = Control.States.SINS;
        }
        if ((f_icode == Control.Codes.IPUSHQ || f_icode == Control.Codes.IPOPQ) && (f_rA == Control.Registers.RNONE || f_rB != Control.Registers.RNONE))
        {
            f_state = Control.States.SINS;
        }
    }