# nested loop demo

# init output loop counter
creg CX0=4

:level_0
creg CX1=3
println "L0 action"

:level_1
creg CX2=2
println "L1 action"

:level_2
println "L2 action"

creg CX2--
if [ CX2 != 0 ] goto level_2
creg CX1--
if [ CX1 != 0 ] goto level_1
creg CX0--
if [ CX0 != 0 ] goto level_0
println "done"
end
