;Example by Joachim Heintz
instr 1 ;i-time loop: counts from 1 until 10 has been reached
icount = 1
count:
print icount
icount = icount + 1
if icount < 11 igoto count
prints "i-END!%n"
endin
instr 2 ;k-rate loop: counts in the 100th k-cycle from 1 to 11
kcount init 0
ktimek timeinstk ;counts k-cycle from the start of this instrument
if ktimek == 100 kgoto loop
kgoto noloop
loop:
printks "k-cycle %d reached!%n", 0, ktimek
kcount = kcount + 1
printk2 kcount
if kcount < 11 kgoto loop
printks "k-END!%n", 0
noloop:
endin
i 1 0 0
i 2 0 1