1 # Copyright (C) 2007-2009, Parrot Foundation.
6 PIR has no built-in looping structures such as C<for>, C<while>,
7 C<repeat> or C<until>. All loops are built by using conditionals
10 The loop below calculates 5 factorial, stored in C<$I0>. C<$I1>
11 is the loop counter. In each loop iteration we decrement the counter
12 to see if we've done the loop enough times. The conditional jump
13 moves control flow back to the top of the loop if more iterations
25 dec $I1 # decrement counter
26 if $I1 > 0 goto REDO # end of loop
37 # vim: expandtab shiftwidth=4 ft=pir: