Files
l2/tests/jmp_test.sl
2026-02-12 17:39:05 +01:00

18 lines
378 B
Plaintext

import stdlib.sl
word main
5 # loop count
get_addr # push loop target address (next instruction)
"gg" puts
swap # bring count to top
1 - # decrement
dup 0 > if
swap # put addr on top
dup # keep a copy for next iteration
jmp
else
drop # drop count
drop # drop addr
end
end