Exemple #1
0
        public override bool Emit(EmitContext ec)
        {
            Expression.EmitToStack(ec);
            ec.EmitComment("!" + Expression.CommentString());
            ec.EmitPop(RegistersEnum.AX);


            ec.EmitInstruction(new Not()
            {
                DestinationReg = RegistersEnum.AX, Size = 80
            });
            ec.EmitInstruction(new And()
            {
                DestinationReg = RegistersEnum.AX, SourceValue = 1, Size = 80
            });
            ec.EmitPush(RegistersEnum.AX);



            return(true);
        }
 /// <summary>
 /// Emit code
 /// </summary>
 /// <returns>Success or fail</returns>
 public override bool Emit(EmitContext ec)
 {
     if (Expression is IntegralExpression)
     {
         EmitIfConstant(ec);
     }
     else
     {
         // emit expression branchable
         ec.EmitComment("if-expression evaluation");
         Expression.EmitBranchable(ec, Else, false);
         ec.EmitComment("(" + Expression.CommentString() + ") is true");
         TrueStatement.Emit(ec);
         ec.EmitInstruction(new Jump()
         {
             DestinationLabel = ExitIf.Name
         });
         ec.MarkLabel(Else);
         ec.EmitComment("Else ");
         FalseStatement.Emit(ec);
         ec.MarkLabel(ExitIf);
     }
     return(true);
 }
Exemple #3
0
 public override string CommentString()
 {
     return("!" + Expression.CommentString());
 }