1
0
mirror of https://github.com/pakt/ropc synced 2026-06-08 16:36:27 +00:00
Files
2012-09-20 02:59:07 -07:00

32 lines
320 B
Plaintext

fun fib(n, out){
x = 0
y = 0
cmp n, 0
je copy
cmp n, 1
je copy
fib(n-1, @x)
fib(n-2, @y)
[out] = x+y
jmp exit
copy:
[out] = n
exit:
}
fun main(){
fmt = "%d\n"
i = 0
x = 0
print:
fib(i, @x)
!printf(fmt, x)
i = i+1
cmp i, 11
jne print
}