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 / tests / a64efi / om2.om

42 lines · 864 bytes Raw Blame History
1note tests/a64efi/om2.om: `target a64efi` then `om2` (the lines run.sh puts first, with efirt.om).
2note An OM-2 form (an unsized array parameter) and globals read and written, with no pinned register:
3note the program prints ==B, om2 7 26, ==E through efi 13.
4global obuf uchar 32
5global acc ulong 4
6
7fn sum a view uchar * n ulong to ulong
8s = ulong 0
9for i ulong n
10s = add s ulong get a i
11end
12ret s
13end
14
15fn main to ulong
16t = new uchar 4 0
17put t 0 5
18put t 1 6
19put t 2 7
20put t 3 8
21put acc 1 7
22put acc 2 sum t 4
23put obuf 0 61
24put obuf 1 61
25put obuf 2 66
26put obuf 3 10
27put obuf 4 111
28put obuf 5 109
29put obuf 6 50
30put obuf 7 32
31put obuf 8 uchar add 48 get acc 1
32put obuf 9 32
33put obuf 10 uchar add 48 div get acc 2 10
34put obuf 11 uchar add 48 rem get acc 2 10
35put obuf 12 10
36put obuf 13 61
37put obuf 14 61
38put obuf 15 69
39put obuf 16 10
40r = efi 13 0 obuf 0 17
41ret 0
42end