Esempio n. 1
0
        internal override string Generate(DirectTranslation translation)
        {
            string v1 = expression1.Generate(translation);
            string v2 = expression2.Generate(translation);
            string i1 = id1.Generate(translation);
            string i2 = id2.Generate(translation);

            translation.AddAssembly("v_mov", "RV14", v1);
            translation.AddAssembly("v_mov", "RV15", v2);
            translation.AddCallerSave();
            translation.AddAssembly("Trace");
            translation.AddCallerRestore();
            translation.AddAssembly("v_mov", i1, "RV14");
            translation.AddAssembly("v_mov", i2, "RV15");
            return(null);
        }
Esempio n. 2
0
        internal override string Generate(DirectTranslation translation)
        {
            string tempVar = func.Type == Type.VECTOR ? ".V" : ".S" + VariableCounter;
            var    args    = expressionList.GenerateArgs(translation, func);

            translation.AddAssembly("s_push", "RS30");
            // translation.AddBranch("jmp_link", identifier);
            translation.AddCallerSave();
            translation.AddFunctionCall(identifier, args, func.Type);
            translation.AddCallerRestore();
            translation.AddAssembly("s_pop", "RS30");
            if (func.Type == Type.VECTOR)
            {
                translation.AddAssembly("v_mov", tempVar, "RV1");
            }
            else
            {
                translation.AddAssembly("s_mov", tempVar, "RS1");
            }
            return(tempVar);
        }