interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / omc / om2 / s4 / v-text-empty.om

32 lines · 719 bytes Raw Blame History
1note S4 empty text (`text e ""`, length 0) as a `view uchar *` argument (spec 6, erratum E2): its count is
2note the number 0, never a count register. x = 7 is live in the register the old lowering read as the
3note count. Checks: len through a parameter, through an inline parameter, len e itself, part e 0 0 and a
4note 0-byte write. Exit 0 when every check holds, else the failing check's number.
5om2
6text e ""
7fn plen v view uchar * to ulong
8ret len v
9end
10fn ilen v view uchar * to ulong inline
11ret len v
12end
13fn main to int
14x = ulong 7
15if ne plen e 0
16ret 1
17end
18if ne ilen e 0
19ret 2
20end
21if ne len e 0
22ret 3
23end
24if ne plen part e 0 0 0
25ret 4
26end
27n = write int 1 e ulong 0 ulong 0
28if ne n 0
29ret 5
30end
31ret int sub x 7
32end