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 / qualification / om2 / sec / s5s7 / pr.om

28 lines · 676 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note sec/s5s7/pr.om: output helpers, appended after a program-mode fixture (case SRC a+b).
3note OM-1 words only, so the same file serves OM-2 fixtures and their OM-1 twins.
4note putd v: v in decimal and a newline on stdout. puth v: 16 lowercase hex digits and a newline.
5text prhex "0123456789abcdef"
6fn putd v ulong to void
7b = new uchar 21 10
8p = ulong 20
9x = v
10go = true
11while go
12p = sub p 1
13put b p add uchar rem x 10 48
14x = div x 10
15if eq x 0
16go = false
17end
18end
19w = write 1 b p sub 21 p
20end
21fn puth v ulong to void
22b = new uchar 17 10
23for i ulong 16
24s = mul sub 15 i 4
25put b i get prhex and shr v s 15
26end
27w = write 1 b 0 17
28end