public override string Template()
 {
     return($"{LeftExpression.Template()}" +
            "\nmovq\t%rax,%rcx" +
            $"\n{RightExpression.Template()}" +
            $"\n{AssignmentTemplate}\t# assign {RightExpression} to {LeftExpression}" +
            $"\n{LeftExpression.Save()}");
 }
示例#2
0
        public override string Template()
        {
            return($"{RightExpression.Template()}\nmovq\t%rax,%rbx\n{LeftExpression.Template()}\n{AssignmentTemplate}\n{LeftExpression.Save()}");

            // var retrieve = $"\nmovq\t{varIndex}(%rbp),%rax";
            // const string div = "\nidiv\t%rbx";
            // var assign = $"\nmovq\t%rax,{varIndex}(%rbp)";
            //
            // return $"{Expression.Template()}" +
            //        "\nmovq\t%rax,%rbx" +
            //        retrieve +
            //        "\ncqo" +
            //        div +
            //        assign;
        }
示例#3
0
 public override string Template()
 {
     return($"{LeftExpression.Template()}\n{AssignmentTemplate}\n{LeftExpression.Save()}");
 }
示例#4
0
 public override string Template()
 {
     return($"{RightExpression.Template()}\nmovq\t%rax,%rbx\n{LeftExpression.Template()}\n{AssignmentTemplate}\nmovq\t$0,%rax\nmovq\t%rdx,%rax\n{LeftExpression.Save()}");
 }