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 / host / tests / args.om
| 1 | text want "two words" |
| 2 | global buf uchar 32 |
| 3 | fn main to int |
| 4 | if ne argcnt 4 |
| 5 | ret 1 |
| 6 | end |
| 7 | n = argread 1 buf 0 len buf |
| 8 | if ne n 0 |
| 9 | ret 2 |
| 10 | end |
| 11 | n = argread 2 buf 3 29 |
| 12 | if ne n long len want |
| 13 | ret 3 |
| 14 | end |
| 15 | for i ulong len want |
| 16 | if ne get buf add i 3 get want i |
| 17 | ret 4 |
| 18 | end |
| 19 | end |
| 20 | put buf 0 42 |
| 21 | n = argread 2 buf 0 1 |
| 22 | if ne n neg long 105 |
| 23 | ret 5 |
| 24 | end |
| 25 | if ne get buf 0 42 |
| 26 | ret 6 |
| 27 | end |
| 28 | n = argread 3 buf 0 len buf |
| 29 | if ne n 2 |
| 30 | ret 7 |
| 31 | end |
| 32 | if or ne get buf 0 207 ne get buf 1 128 |
| 33 | ret 8 |
| 34 | end |
| 35 | ret 0 |
| 36 | end |