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-mv/blob/main/seed/helix/strand3_trickster/loadC0.sh # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / seed / helix / strand3_trickster / loadC0.sh` 16 lines ยท 579 bytes Raw Blame History 1 #!/bin/sh 2 # loadC0.sh -- turn seedC0.c0 (colon-separated hex bytes with '%' comments) into the 404-byte W^X binary. 3 set -eu 4 [ "$#" -eq 2 ] || { printf 'usage: loadC0.sh INPUT OUTPUT\n' >&2; exit 2; } 5 hex=$(sed 's/%.*//' "$1" | tr -d ' \t\r\n:') 6 case $(( ${#hex} % 2 )) in 7 0) ;; 8 *) printf 'loadC0: odd hex nibble count\n' >&2; exit 12 ;; 9 esac 10 printf '%s\n' "$hex" | fold -w 2 | while IFS= read -r b; do 11 case "$b" in 12 [0-9a-fA-F][0-9a-fA-F]) printf "\\$(printf '%03o' "0x$b")" ;; 13 *) printf 'loadC0: bad byte %s\n' "$b" >&2; exit 11 ;; 14 esac 15 done > "$2" 16 chmod +x "$2"