diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/while.sil | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/while.sil b/examples/while.sil index 49186fb..fb2778b 100644 --- a/examples/while.sil +++ b/examples/while.sil @@ -1,3 +1,9 @@ +Void sleep(Int n) { + |~ pushI_a 0 + |~ ccall sleep "I:I" + |~ pop_b 1 +} + Void print(Int n) { |~ push_a 0 |~.d 1 0 @@ -8,6 +14,7 @@ Void print(Int n) { Int loop(Int start, Int end) { while (!(start == end)) { print(start); + sleep(start); start := start + 1; } return start; |