code wiki / _hdl_build / nx_log2_beget.nx
nx_log2_beget.nx source
↩ module page · 19 lines · 839 B
1// nx_log2_beget.nx -- DRIVER for EXAM-2: drive the MATH_KERNEL emitter-kid (pe6_author_log2)
2// to BEGET the nx_f64_log2 kernel from the SOVEREIGN _pm_log_spec. Reconstructable: re-run =>
3// byte-identical nx_f64_log2.nx + _test.nx. author(kernel)=emitter. license_tier: ORIGINAL
4import "nx_pattern_emit6_log2.nx"
5import "_pm_log_spec.nx"
6import "nx_syscalls.nx"
7
8func main() -> i64 {
9 let c: *i64 = sys_mmap(8 * 32) as *i64
10 let nco: i64 = pm_log_spec_fill(c)
11 let rc: i64 = pe6_author_log2("nx_f64_log2" as *u8, "nx_f64_log2.nx" as *u8, "runtime/_hdl_build/nx_f64_log2.nx" as *u8, "runtime/_hdl_build/nx_f64_log2_test.nx" as *u8, c, nco)
12 if rc == 1 {
13 sys_write(1, "LOG2-BEGET OK author=emitter\n" as *u8, 29)
14 sys_exit(0)
15 }
16 sys_write(1, "LOG2-BEGET FAIL\n" as *u8, 16)
17 sys_exit(1)
18 return 0
19}