예제 #1
0
        public void Execute(ProgramFile program)
        {
            switch (Condition)
            {
            case JumpCondition.LessThan:
                if (RegisterOne.Value < RegisterTwo.Value)
                {
                    program.Jump(Label);
                }

                break;

            case JumpCondition.LessThanOrEqual:
                if (RegisterOne.Value <= RegisterTwo.Value)
                {
                    program.Jump(Label);
                }

                break;

            case JumpCondition.Equal:
                if (RegisterOne.Value == RegisterTwo.Value)
                {
                    program.Jump(Label);
                }

                break;

            case JumpCondition.GreaterThanOrEqual:
                if (RegisterOne.Value >= RegisterTwo.Value)
                {
                    program.Jump(Label);
                }

                break;

            case JumpCondition.GreaterThan:
                if (RegisterOne.Value > RegisterTwo.Value)
                {
                    program.Jump(Label);
                }

                break;

            case JumpCondition.NotEqual:
                if (RegisterOne.Value != RegisterTwo.Value)
                {
                    program.Jump(Label);
                }

                break;
            }
        }
 public void Execute(ProgramFile program)
 {
     program.Jump(Label);
 }