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 / tests / pools / g4.om

43 lines · 788 bytes Raw Blame History
1om2
2note gate-pools 4: the first global is a pool, sized globals follow. The pool takes no pinned register: the
3note set of X18..X26 written by this unit equals that of g4base.om (the same unit without the pool).
4global P ulong *
5global g ulong 10
6global h ulong 5000
7global ob uchar 24
8fn pnum v ulong to void
9put ob 23 10
10i = ulong 23
11x = v
12go = true
13while go bound 21
14i = sub i 1
15put ob i uchar add rem x 10 48
16x = div x 10
17go = ne x 0
18end
19k = write 1 ob i sub 24 i
20end
21fn plong v long to void
22if lt v 0
23put ob 0 uchar 45
24k = write 1 ob 0 1
25pnum ulong neg v
26else
27pnum ulong v
28end
29end
30fn main to int
31r = enlarge P ulong 1000
32put P 999 5
33put g 9 6
34put h 4999 7
35r = enlarge P ulong 1000000
36put P 999999 8
37pnum get P 999
38pnum get g 9
39pnum get h 4999
40pnum get P 999999
41pnum len P
42ret 0
43end