예제 #1
0
                protected override void EmitAfterBody(IRoutineBuilder rb, ILabel againLabel)
                {
                    // increment
                    bool down;

                    if (inc != null)
                    {
                        int incValue;

                        if (inc is ZilFix fix && (incValue = fix.Value) < 0)
                        {
                            rb.EmitBinary(BinaryOp.Sub, counter, cc.Game.MakeOperand(-incValue), counter);
                            down = true;
                        }
                        else if (inc.IsNonVariableForm())
                        {
                            var operand = cc.CompileAsOperand(rb, inc, src, counter);
                            if (operand != counter)
                            {
                                rb.EmitStore(counter, operand);
                            }
                            down = false;
                        }
                        else
                        {
                            var operand = cc.CompileAsOperand(rb, inc, src);
                            rb.EmitBinary(BinaryOp.Add, counter, operand, counter);
                            down = false;
                        }
                    }