code wiki / _hdl_build / _nxasm_ctx_probe.nx
_nxasm_ctx_probe.nx source
↩ module page · 21 lines · 894 B
1// _nxasm_ctx_probe.nx -- does nxasm behave differently by PARENT CONTEXT on
2// identical input? Spawns nxasm on the KNOWN-GOOD /tmp/_adm.s (assembles
3// rc=0 from bash) from THIS sovereign-compiled parent and prints the rc.
4// rc=6 here + rc=0 from bash = the R1-T1-006 uninit-read class IN THE
5// TOOLCHAIN, and the true face of R1-T1-004's "intermittent" rc=6.
6// license_tier: ORIGINAL
7import "nx_dc_core.nx"
8
9func main() -> i64 {
10 let neg: i64 = 0 - 1
11 let rc1: i64 = dc_spawn("_offc/nxasm_x86_main.elf" as *u8, "/tmp/_adm.s" as *u8, "/tmp/_adm_ctx.elf" as *u8, neg)
12 dc_w(1, "NXASMCTX run1 rc=" as *u8)
13 dc_wn(1, rc1)
14 dc_w(1, "\n" as *u8)
15 let rc2: i64 = dc_spawn("_offc/nxasm_x86_main.elf" as *u8, "/tmp/_adm.s" as *u8, "/tmp/_adm_ctx.elf" as *u8, neg)
16 dc_w(1, "NXASMCTX run2 rc=" as *u8)
17 dc_wn(1, rc2)
18 dc_w(1, "\n" as *u8)
19 sys_exit(0)
20 return 0
21}