code wiki / _hdl_build / nx_wasm_emit_seed.nx

nx_wasm_emit_seed.nx

buildroot/runtime/_hdl_build/nx_wasm_emit_seed.nx

3803 B85 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind orphan librarytopic wasm
docsdependenciesstructsconstsfunctions

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

leb128.nx nx_syscalls.nx nx_wasm_emit_seed.nx

imports: leb128.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

10const K_MAGIC_1024: i64 = 1024

functions

12func w8(b: *u8, p: i64, v: i64) -> i64 { b[p] = v as u8; return p + 1 }
13func wcopy(dst: *u8, dp: i64, src: *u8, n: i64) -> i64
20func emit_section(out: *u8, p: i64, id: i64, sc: *u8, sclen: i64) -> i64
27func main() -> i64