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-frk4096.om
| 1 | note for test at the latch on both sides of the CMP immediate limit: K = 4095 fits the 12-bit field |
| 2 | note (CMP Xi, #K), K = 4096 does not (matconst then CMP Xi, Xk); 4095 + 4096 passes (exit 0). A latch that |
| 3 | note encodes 4096 as an immediate (bit 22: CMP Xi, #0, LSL #12) leaves after 1 pass; 4095 + 1 - 8191 wraps |
| 4 | note and the int conversion traps 5 (exit 105) |
| 5 | om2 |
| 6 | fn main to int |
| 7 | a = ulong 0 |
| 8 | for i ulong 4095 |
| 9 | a = add a 1 |
| 10 | end |
| 11 | b = ulong 0 |
| 12 | for j ulong 4096 |
| 13 | b = add b 1 |
| 14 | end |
| 15 | ret int sub add a b 8191 |
| 16 | end |