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
omega-mv / seed / ng / a64 / tests / macho / lib / libshort.om
| 1 | target macos |
| 2 | note libshort: a register file of fewer than 128 bytes is refused before anything is called: trap 3 (status 103). |
| 3 | fn p64 b edit uchar 128 o ulong v ulong to void |
| 4 | for i ulong 8 |
| 5 | put b add o i uchar and shr v mul i 8 255 |
| 6 | end |
| 7 | end |
| 8 | |
| 9 | fn g64 b view uchar 128 o ulong to ulong |
| 10 | v = ulong 0 |
| 11 | for i ulong 8 |
| 12 | v = or v shl ulong get b add o i mul i 8 |
| 13 | end |
| 14 | ret v |
| 15 | end |
| 16 | |
| 17 | fn main to int |
| 18 | rg = new uchar 128 0 |
| 19 | r = libcall ulong libfn 1 rg 0 120 |
| 20 | ret 9 |
| 21 | end |