code wiki / _hdl_build / nx_x86_wasm_gate.nx
nx_x86_wasm_gate.nx
buildroot/runtime/_hdl_build/nx_x86_wasm_gate.nx
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
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
structs
| none |
consts
| 8 | const CWAT_ELF: *u8 = "/tmp/nx_compile_wat.sov.elf" |
| 9 | const WATC_ELF: *u8 = "/tmp/nx_wat_compiler.sov.elf" |
| 10 | const SRC_NX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_x86.nx" |
| 11 | const OUT_WAT: *u8 = "/tmp/x86.wat" |
| 12 | const OUT_WASM: *u8 = "/tmp/x86.wasm" |
functions
| 14 | func 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 } |
| 15 | func g_pn(v: i64) -> i64 |
| 29 | func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64 |
| 48 | func xreset(mod: *WasmMod) -> i64 { return wm_run(mod, "x86_reset" as *u8, 0, 0, 0, 0, 0, 1) } |
| 49 | func xload(mod: *WasmMod, addr: i64, byte: i64) -> i64 { return wm_run(mod, "x86_load" as *u8, 0, addr, byte, 0, 0, 3) } |
| 50 | func xrun(mod: *WasmMod, cap: i64) -> i64 { return wm_run(mod, "x86_run" as *u8, 0, cap, 0, 0, 0, 2) } |
| 51 | func xreg(mod: *WasmMod, r: i64) -> i64 { return wm_run(mod, "x86_reg" as *u8, 0, r, 0, 0, 0, 2) } |
| 52 | func xzf(mod: *WasmMod) -> i64 { return wm_run(mod, "x86_zf" as *u8, 0, 0, 0, 0, 0, 1) } |
| 54 | func load_ab(mod: *WasmMod, cmpval: i64) -> i64 |
| 67 | func main() -> i64 |