interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / ng / a64 / tests / front / fib39.om

28 lines · 585 bytes Raw Blame History
1note rgate front-phase negative control: seed/ng/front/kernels/fib40.om with fib 39 in main. omc compiles this
2note file as the reference for fib40's front-ir and a64 build; the stdout lines (63245986 against 102334155) must differ.
3global out uchar 32
4fn fib n ulong to ulong
5if lt n 2
6ret n
7end
8a = fib sub n 1
9b = fib sub n 2
10ret add a b
11end
12fn putnum v ulong to void
13put out 31 10
14p = ulong 31
15x = v
16while gt x 9
17p = sub p 1
18put out p uchar add rem x 10 48
19x = div x 10
20end
21p = sub p 1
22put out p uchar add x 48
23w = write 1 out p sub 32 p
24end
25fn main to int
26putnum fib 39
27ret 0
28end