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 / omc / om2 / s5 / scrub-live.om

61 lines · 866 bytes Raw Blame History
1note S5 scrub: live values survive. Parameters, register locals, a local array above SP, the held left operand
2note of an expression and an earlier call argument keep their values across scrub. Exit 0, else the check.
3om2
4fn two a ulong b ulong c ulong to ulong
5ret add mul a 100 add mul b 10 c
6end
7fn keep a ulong b ulong c ulong to ulong
8arr = new ulong 4 7
9put arr 3 a
10x = add a b
11y = add x ulong scrub 4096
12if ne y x
13ret 1
14end
15if ne a 11
16ret 2
17end
18if ne b 22
19ret 3
20end
21if ne c 33
22ret 4
23end
24if ne get arr 3 11
25ret 5
26end
27if ne get arr 0 7
28ret 6
29end
30z = add mul a 1000 add b ulong scrub 16
31if ne z 11022
32ret 7
33end
34w = two 4 ulong scrub 1048576 6
35if ne w 406
36ret 8
37end
38if ne x 33
39ret 9
40end
41ret 0
42end
43fn main to int
44p = ulong 5
45q = long 9
46r = keep 11 22 33
47if ne r 0
48ret int r
49end
50k = scrub 64
51if ne p 5
52ret 20
53end
54if ne q 9
55ret 21
56end
57if ne k 0
58ret 22
59end
60ret 0
61end