Ejemplo n.º 1
0
        public string ResolveVariable(long value)
        {
            string variableName    = "";
            long   variableMemType = (value >> 28) & 0xF;
            long   variableType    = (value >> 24) & 0xF;
            long   variableNumber  = (value & 0xFFFFFF);

            if (variableMemType == 0)
            {
                variableName = "IC."; mem = VarMemType.IC;
            }
            if (variableMemType == 1)
            {
                variableName = "LA."; mem = VarMemType.LA;
            }
            if (variableMemType == 2)
            {
                variableName = "RA."; mem = VarMemType.RA;
            }
            if (variableType == 0)
            {
                variableName += "Basic"; type = VariableType.Basic;
            }
            if (variableType == 1)
            {
                variableName += "Float"; type = VariableType.Float;
            }
            if (variableType == 2)
            {
                variableName += "Bit"; type = VariableType.Bit;
            }
            variableName += "[" + (number = (int)variableNumber) + "]";

            return(variableName);
        }
Ejemplo n.º 2
0
        public static void SetVar(VariableType var, VarMemType mem, int num, double value)
        {
            switch (mem)
            {
            case VarMemType.IC: break;

            case VarMemType.LA: LA.Set(var, num, value); break;

            case VarMemType.RA: RA.Set(var, num, value); break;
            }
        }
Ejemplo n.º 3
0
        public static float GetVar(VariableType var, VarMemType mem, int num)
        {
            switch (mem)
            {
            case VarMemType.IC: return(IC.Get(var, num));

            case VarMemType.LA: return(LA.Get(var, num));

            case VarMemType.RA: return(RA.Get(var, num));
            }
            return(0.0f);
        }
Ejemplo n.º 4
0
 public static void SetVar(VariableType var, VarMemType mem, int num, float value)
 {
     switch (mem)
     {
         case VarMemType.IC: break;
         case VarMemType.LA: LA.Set(var, num, value); break;
         case VarMemType.RA: RA.Set(var, num, value); break;
     }
 }
Ejemplo n.º 5
0
 public static float GetVar(VariableType var, VarMemType mem, int num)
 {
     switch (mem)
     {
         case VarMemType.IC: return IC.Get(var, num);
         case VarMemType.LA: return LA.Get(var, num);
         case VarMemType.RA: return RA.Get(var, num);
     }
     return 0.0f;
 }
Ejemplo n.º 6
0
        public string ResolveVariable(long value)
        {
            string variableName = "";
            long variableMemType = (value >> 28) & 0xF;
            long variableType = (value >> 24) & 0xF;
            long variableNumber = (value & 0xFFFFFF);
            if (variableMemType == 0) { variableName = "IC."; mem = VarMemType.IC; }
            if (variableMemType == 1) { variableName = "LA."; mem = VarMemType.LA; }
            if (variableMemType == 2) { variableName = "RA."; mem = VarMemType.RA; }
            if (variableType == 0) { variableName += "Basic"; type = VariableType.Basic; }
            if (variableType == 1) { variableName += "Float"; type = VariableType.Float; }
            if (variableType == 2) { variableName += "Bit"; type = VariableType.Bit; }
            variableName += "[" + (number = (int)variableNumber) + "]";

            return variableName;
        }