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 / front / cases / sh_mix_neg.om
| 1 | note sh_mix_neg: a ulong value shifted by an int amount of -1 traps 7 (exit 107) in omc: the sign-extended |
| 2 | note amount is at or past the width when compared unsigned. "n\n" comes first. |
| 3 | text t "n\n" |
| 4 | fn shn a ulong s int to ulong |
| 5 | ret shl a s |
| 6 | end |
| 7 | fn main to int |
| 8 | w = write 1 t 0 2 |
| 9 | x = shn 1 -1 |
| 10 | ret int and x 255 |
| 11 | end |