code wiki / (root) / nx_smoke_asm_d4.nx

nx_smoke_asm_d4.nx source

↩ module page · 22 lines · 895 B

1// Return raw n (not masked) -- exit code is u8 anyway, but let's 2// see if it matches; also try returning n+100 to detect overflow. 3// nx_safety_envelope: 4// intended_use: AUTO_APPLIED -- primitive-specific tuning queued 5// sil_target: SIL1 6// evidence: [bulk_applied_2026-05-16, see-file-comment-for-detail] 7// verdict: NOT_YET_EVALUATED 8 9import "nx_syscalls.nx" 10import "nxasm_v2.nx" 11 12func main() -> i64 { 13 let s: *u8 = ".text\n.globl main\nmain:\naddi sp, sp, -16\nsd ra, 8(sp)\nli a0, 30\nret\n" 14 var sl: i64 = 0 15 while s[sl] != 0 { sl = sl + 1 } 16 let out: *u8 = alloc(64) 17 let n: i64 = assemble(s, sl, out, 64) 18 if n == 16 { return __syscall(93, 50, 0, 0, 0, 0, 0) } 19 if n == 12 { return __syscall(93, 60, 0, 0, 0, 0, 0) } 20 if n < 0 { return __syscall(93, 70, 0, 0, 0, 0, 0) } 21 return __syscall(93, 80, 0, 0, 0, 0, 0) 22}