code wiki / _hdl_build / nx_wasm_emit_seed.nx
nx_wasm_emit_seed.nx
buildroot/runtime/_hdl_build/nx_wasm_emit_seed.nx
about
nx_wasm_emit_seed.nx -- SEED of the sovereign WAT->WASM emitter (G-WASM-001 milestone 1).
Emits a real WebAssembly BINARY module BYTE-BY-BYTE from the encoding rules (NOT a memcpy
of known output) for: (module (func (export "main") (result i64) i64.const 42)).
Reuses runtime/leb128.nx (the verified LEB128 organ) for all sizes/counts/operands.
Proves the sovereign encoding is byte-correct vs WABT used ONCE as an alignment oracle
(then WABT leaves the path) -- the same pattern as qemu aligning the rv64 emu.
NO node, NO python, NO WABT in this organ. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: leb128.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 10 | const K_MAGIC_1024: i64 = 1024 |
functions
| 12 | func w8(b: *u8, p: i64, v: i64) -> i64 { b[p] = v as u8; return p + 1 } |
| 13 | func wcopy(dst: *u8, dp: i64, src: *u8, n: i64) -> i64 |
| 20 | func emit_section(out: *u8, p: i64, id: i64, sc: *u8, sclen: i64) -> i64 |
| 27 | func main() -> i64 |