Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-bridge/blob/main/tests/native/v2/lay.om # omega-bridge Omega-first language interoperability: checked conversion backends and native language bindings Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-bridge / tests / native / v2 / lay.om` 45 lines ยท 903 bytes Raw Blame History 1 note lay.om: an OM-2 unit for the native ABI v2 tests (tests/native/v2/run.sh): a layout parameter and 2 note out parameters. 3 note bridge c-type blk lay_blk 4 note bridge c-define LAY_TAG_SIZE 8 5 om2 6 layout blk 24 7 field a uint at 0 little 8 field n ulong at 8 little 9 field tag uchar 8 at 16 little 10 end 11 export fn absorb c edit blk d view uchar * to void 12 s = get c a 13 for i ulong len d 14 s = add s uint get d i 15 end 16 put c a s 17 put c n add get c n len d 18 end 19 export fn digest c view blk o out uchar 16 to ulong 20 for i ulong 8 21 put o i get c tag i 22 end 23 x = get c a 24 for i ulong 4 25 put o add 8 i uchar and x 255 26 x = shr x 8 27 end 28 ret get c n 29 end 30 export fn swap8 d view uchar * o out uchar 8 to ulong 31 for i ulong 8 32 put o i get d sub 7 i 33 end 34 ret len d 35 end 36 export fn halt o out ulong 2 to void 37 put o 0 7 38 trap 9 39 end 40 export fn two a out uchar 4 b out uchar 4 to void 41 for i ulong 4 42 put a i uchar add i 1 43 put b i uchar add i 5 44 end 45 end