code wiki / _hdl_build / nx_builder_authors_bitreader.nx

nx_builder_authors_bitreader.nx source

↩ module page · 13 lines · 756 B

1// nx_builder_authors_bitreader.nx -- the BUILDER authors an LSB-first bit reader (Claude tutored the template; 2// the Builder writes the artifact). Emits _bitreader_authored.nx; the Engineer compiles+runs it (nx_build_run). 3import "nx_module_author.nx" 4import "nx_syscalls.nx" 5func _b(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 6func main() -> i64 { 7 _b("BUILDER authors an LSB-first bit reader (DEFLATE foundation)\n" as *u8) 8 let fd: i64 = sys_openat_wr("runtime/_hdl_build/_bitreader_authored.nx" as *u8, 0x1a4) 9 ma_emit_bitreader(fd, "br_bits" as *u8) 10 sys_close(fd) 11 _b(" -> runtime/_hdl_build/_bitreader_authored.nx authored; Engineer verifies next\n" as *u8) 12 sys_exit(0); return 0 13}