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-harness/blob/main/examples/om2_hex_rotr.om # omega-harness Agent skills for operating, encoding and communicating in Omega (.om) and the AIEN repositories 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-harness / examples / om2_hex_rotr.om` 40 lines ยท 869 bytes Raw Blame History 1 note om2_hex_rotr: the first line that is not blank or a note opts in to OM-2: hex literals and rotr 2 om2 3 note ---- OM-2 output helpers: an unsized view parameter takes an array or text of any length 4 note outv: write all of a to stdout; a short write continues, 0 or an error exits 90 5 fn outv a view uchar * to void 6 e = len a 7 p = ulong 0 8 while lt p e bound 65536 9 k = write 1 a p sub e p 10 if le k 0 11 exit 90 12 end 13 p = add p ulong k 14 end 15 end 16 note putu: v in decimal, then a newline 17 note a part of a global is error 19, so the digits go in a local array 18 fn putu v ulong to void 19 b = new uchar 21 0 20 i = ulong 20 21 put b 20 10 22 n = v 23 while true bound 20 24 i = sub i 1 25 put b i uchar add rem n 10 48 26 n = div n 10 27 if eq n 0 28 break 29 end 30 end 31 outv part b i sub 21 i 32 end 33 fn main to int 34 x = uint 0xdeadbeef 35 putu ulong x 36 putu ulong rotr x 8 37 putu 0xffffffffffffffff 38 putu ulong and x 0xff 39 ret 0 40 end