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 / qualification / om2 / sec / s0s2 / lib / putu.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note OM-1 helper appended after a fixture (SRC a+b): putu v writes v in decimal and a newline to stdout. |
| 3 | note It has no om2 line of its own; the unit's first non-note line comes from the fixture in front. |
| 4 | fn putu v ulong to void |
| 5 | b = new uchar 21 10 |
| 6 | p = ulong 20 |
| 7 | x = v |
| 8 | while true |
| 9 | p = sub p 1 |
| 10 | put b p uchar add rem x 10 48 |
| 11 | x = div x 10 |
| 12 | if eq x 0 |
| 13 | break |
| 14 | end |
| 15 | end |
| 16 | r = write 1 b p sub 21 p |
| 17 | end |