Something went wrong. Try again.
OR-1 dataflow CPU sketch
Something went wrong. Try again.
840 B · 36 lines
at main
12345678910111213141516171819202122232425262728293031323334353637@system pe=2, sm=1
$fib |> { ; ── function body ── &n <| pass lt &n, 2 |> &test &test <| sweq &n |> &test:L
; base case &test:L |> @ret
; recursive case sub &n, 1 |> &n1 sub &n, 2 |> &n2
; two calls, each 3 monadic IRAM slots + shared stub &__alloc1 <| rd_inc, @ctx_alloc &__exec1 <| exec, @fib_call_seq &__extag1 <| extract_tag, 20 ; results arrive at offset 20
&__alloc1 |> &__fib_ctx_fan &__extag1 |> &__fib_ct_ret:R &n1 |> &__fib_ct_n:R
&__alloc2 <| rd_inc, @ctx_alloc &__exec2 <| exec, @fib_call_seq &__extag2 <| extract_tag, 21 ; results arrive at offset 21
&__alloc2 |> &__fib_ctx_fan &__extag2 |> &__fib_ct_ret:R &n2 |> &__fib_ct_n:R
; reduction add &r1, &r2 |> @ret ; r1 at offset 20, r2 at offset 21}