code wiki / _hdl_build / nx_x86_wasm_gate.nx

nx_x86_wasm_gate.nx

buildroot/runtime/_hdl_build/nx_x86_wasm_gate.nx

5192 B110 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic x86
docsdependenciesstructsconstsfunctions

about

nx_x86_wasm_gate.nx -- R1.0a WASM proof: compiles nx_x86.nx to wasm via the sovereign pipeline and runs the same three programs in nx_wasm_vm, checking the results match native. Proves the x86 skeleton is browser-ready, bit-identical to native. NISHI all the way (fork sovereign compilers -> nx_wasm_vm, no .sh).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_gate_emit_lib.nx nx_wasm_vm.nx nx_x86_wasm_gate.nx

imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_wasm_vm.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main g_puts sys_write run_elf sys_fork sys_mmap sys_execve sys_exit sys_wait4 g_pn sys_mmap ↻ sys_write ↻ sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit ↻ wm_new sys_mmap ↻ wm_parse sys_mmap ↻ wv_u8 wv_uleb g_check g_puts sys_write ↻ wm_find_export wm_name_eq xreset wm_run wm_find_export ↻ sys_mmap ↻ wm_call sys_mmap ↻ wv_u8 ↻ wm_memo_get wm_match_end

structs

none

consts

8const CWAT_ELF: *u8 = "/tmp/nx_compile_wat.sov.elf"
9const WATC_ELF: *u8 = "/tmp/nx_wat_compiler.sov.elf"
10const SRC_NX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_x86.nx"
11const OUT_WAT: *u8 = "/tmp/x86.wat"
12const OUT_WASM: *u8 = "/tmp/x86.wasm"

functions

14func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
15func g_pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
29func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64
48func xreset(mod: *WasmMod) -> i64 { return wm_run(mod, "x86_reset" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main calls 1: wm_run
49func xload(mod: *WasmMod, addr: i64, byte: i64) -> i64 { return wm_run(mod, "x86_load" as *u8, 0, addr, byte, 0, 0, 3) }
called by 2: load_abmain calls 1: wm_run
50func xrun(mod: *WasmMod, cap: i64) -> i64 { return wm_run(mod, "x86_run" as *u8, 0, cap, 0, 0, 0, 2) }
called by 1: main calls 1: wm_run
51func xreg(mod: *WasmMod, r: i64) -> i64 { return wm_run(mod, "x86_reg" as *u8, 0, r, 0, 0, 0, 2) }
called by 1: main calls 1: wm_run
52func xzf(mod: *WasmMod) -> i64 { return wm_run(mod, "x86_zf" as *u8, 0, 0, 0, 0, 0, 1) }
called by 1: main calls 1: wm_run
54func load_ab(mod: *WasmMod, cmpval: i64) -> i64
called by 1: main calls 1: xload
67func main() -> i64