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 / omc / cflow / pl-frneg8.om
| 1 | note for test at the latch on a byte counter (type 6, the smallest signed type) that the body makes negative |
| 2 | note (B.LT, not B.LO): the first pass sets i to -5, so i = 0, -4 .. 2 runs 8 passes (exit 8); an unsigned |
| 3 | note latch test leaves after 1 pass. frneg pins the same choice for long (type 9). |
| 4 | om2 |
| 5 | fn main to int |
| 6 | n = long 0 |
| 7 | for i byte 3 |
| 8 | if eq n 0 |
| 9 | i = sub i 5 |
| 10 | end |
| 11 | n = add n 1 |
| 12 | end |
| 13 | ret int n |
| 14 | end |