code wiki / _hdl_build / _race6_team_author2.nx
_race6_team_author2.nx source
↩ module page · 26 lines · 1245 B
1// _race6_team_author2.nx -- the BUILDER re-authoring the race-6 PNG core AFTER the growth rung
2// (race-6b). Race-6a's 8 lost rows named ONE concept: the 4 trailing CRC bytes. emit7 v3 makes
3// trail_w a spec param; the core keeps its name (_pe_png) so the emit9 lane is untouched.
4// Rail proven: trail_w=9 is REFUSED. license_tier: ORIGINAL
5import "nx_pattern_emit7.nx"
6import "nx_syscalls.nx"
7
8func r6b_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
9
10func main() -> i64 {
11 let spec: *i64 = sys_mmap(64) as *i64
12 spec[0] = 4; spec[1] = 4; spec[2] = 0; spec[3] = 0; spec[4] = 0; spec[5] = 4
13 let a: i64 = pe7_author_wire_tlv3("_pe_png" as *u8,
14 "runtime/_hdl_build/_pe_png.nx" as *u8,
15 "runtime/_hdl_build/_pe_png_test.nx" as *u8,
16 spec)
17 spec[5] = 9
18 let r1: i64 = pe7_author_wire_tlv3("_pe_badtrail" as *u8, "/tmp/_pe_badtrail.nx" as *u8, "/tmp/_pe_badtrail_test.nx" as *u8, spec)
19 if a == 1 { if r1 == 0 {
20 r6b_w("TEAM AUTHORED race-6b core: _pe_png (WIRE_TLV v3, trail_w=4 = PNG CRC) -- growth live, rail proven\n" as *u8)
21 sys_exit(0)
22 } }
23 r6b_w("author FAILED (growth defect or rail broken)\n" as *u8)
24 sys_exit(1)
25 return 1
26}