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 / ref / wid.om
| 1 | note ref/wid.om: omc reference of mkir fixture wid (exit = (2000029900 + 5) mod 256 = 209) |
| 2 | global gb byte 2 |
| 3 | global gs ushort 2 |
| 4 | global gh short 2 |
| 5 | global gu uint 2 |
| 6 | global gi int 2 |
| 7 | fn main to int |
| 8 | put gb 1 byte -100 |
| 9 | put gs 1 ushort 60000 |
| 10 | put gh 1 short -30000 |
| 11 | put gu 1 uint 4000000000 |
| 12 | put gi 1 int -2000000000 |
| 13 | s = long get gb 1 |
| 14 | s = add s long get gs 1 |
| 15 | s = add s long get gh 1 |
| 16 | s = add s long get gu 1 |
| 17 | s = add s long get gi 1 |
| 18 | if eq get gb 1 byte -100 |
| 19 | s = add s long 1 |
| 20 | end |
| 21 | if eq get gs 1 ushort 60000 |
| 22 | s = add s long 1 |
| 23 | end |
| 24 | if eq get gh 1 short -30000 |
| 25 | s = add s long 1 |
| 26 | end |
| 27 | if eq get gu 1 uint 4000000000 |
| 28 | s = add s long 1 |
| 29 | end |
| 30 | if eq get gi 1 int -2000000000 |
| 31 | s = add s long 1 |
| 32 | end |
| 33 | ret int rem s 256 |
| 34 | end |