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 / hex / places-hex.om

44 lines · 1034 bytes Raw Blame History
1note SPDX-License-Identifier: Apache-2.0
2note spec/omegese-om2.md section 2 lines 53-58 (#745): a hex literal is accepted in every place a decimal one is:
3note const value, global length, view and edit parameter lengths, new length and fill, put index and
4note value, unroll count, while bound, rotr/rotl operands, f64/f32 conversion (rounded as decimal),
5note trap code, and operand. Expected stdout and exit from Wolfram (wolfram.txt query places).
6om2
7const KC uchar 0xc8
8global g ulong 0x10
9fn rd t view uchar 0x8 to ulong
10ret ulong get t 0x7
11end
12fn wr s edit uchar 0x8 fresh to void
13put s 0x7 0x5a
14end
15fn main to int
16a = new uchar 0x8 0x0
17wr a
18putu rd a
19put g 0xf 0x7
20putu get g 0xf
21putu ulong KC
22s = ulong 0x0
23for i ulong 0x4 unroll
24s = add s i
25end
26putu s
27k = ulong 0x0
28while lt k 0x64 bound 0x3e8
29k = add k 0x1
30end
31putu k
32r = rotr uint 0x80000001 0x1f
33putu ulong r
34q = rotl ulong 0x8000000000000000 0x1
35putu q
36f = f64 0x20000000000001
37putu ulong f
38h = f32 0x1000001
39putu ulong h
40if eq k 0x0
41trap 0xe
42end
43ret int and k 0x2a
44end