vextoly/cryn

[# iterative fibonacci: prints fib(1) .. fib(12) #]
make string "\n" nl

define newline result nothing
  address nl
  output text
  set nothing
  return
end

define main
  make int64 a
  make int64 b
  make int64 t
  make int64 n

  set 1
  move a
  write
  set 1
  move b
  write
  set 12
  move n
  write
  set 0
  home

  mark loop
  move n
  read
  compare 0
  jump done when less-or-equal
  set 0
  home

  move a
  read
  output
  call newline

  move b
  read
  push
  move a
  read
  push
  move b
  read
  add
  push
  move b
  write
  pop
  pop
  move a
  write

  move n
  read
  subtract 1
  move n
  write
  set 0
  home
  jump loop

  mark done
  return
end