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 / tools / sm121dis / oracle_pairs.sh

15 lines · 816 bytes Raw Blame History
1#!/bin/sh
2# oracle_pairs.sh <nvdisasm -hex output>: one line per instruction, "<addr> <low 64 bits> <high 64 bits> <text> ;",
3# text with spacing collapsed but the space before the semicolon kept (nvdisasm leaves it out on padding words).
4# The C6 oracle side (docs/OMEGA.md): nvdisasm decodes, nothing it prints enters a kernel.
5awk '
6/^[[:space:]]*\/\*[0-9a-f]+\*\// {
7 line = $0
8 addr = line; sub(/^[[:space:]]*\/\*/, "", addr); sub(/\*\/.*/, "", addr)
9 txt = line; sub(/^[[:space:]]*\/\*[0-9a-f]+\*\/[[:space:]]*/, "", txt); sub(/;.*$/, ";", txt)
10 lo = line; sub(/.*\/\* 0x/, "", lo); sub(/ \*\/.*/, "", lo)
11 gsub(/[[:space:]]+/, " ", txt)
12 pend = 1; next
13}
14pend && /\/\* 0x[0-9a-f]+ \*\// { hi = $0; sub(/.*\/\* 0x/, "", hi); sub(/ \*\/.*/, "", hi); print addr, lo, hi, txt; pend = 0 }
15' "$1"