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 / ref / lv.om

26 lines · 572 bytes Raw Blame History
1note ref/lv.om: omc reference of mkir fixture lv (exit = lv(9) low byte). The fixture keeps v_0 .. v_19 live in
2note registers across chk.add, chk.mul and chk.bounds; here they sit in a global, the checks being Omega's own.
3global v ulong 20
4global g ulong 8
5
6fn lv n ulong to ulong
7k = ulong 0
8while lt k 20 bound 20
9put v k add mul n add mul k 2 3 add mul k k 1
10k = add k 1
11end
12c = add get v 0 get v 1
13d = mul get v 2 get v 3
14e = get g and n 7
15s = n
16k = 0
17while lt k 20 bound 20
18s = xor mul s 5 get v k
19k = add k 1
20end
21ret s
22end
23
24fn main to int
25ret int and lv 9 255
26end