code wiki / (root) / nx_smoke_asm_d7.nx

nx_smoke_asm_d7.nx source

↩ module page · 16 lines · 618 B

1// Pure string-literal sanity check. Same string as test22. 2// Returns the strlen() of the literal. Expected: 68. 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" 10 11func main() -> i64 { 12 let s: *u8 = ".text\n.globl main\nmain:\naddi sp, sp, -16\nsd ra, 8(sp)\nli a0, 30\nret\n" 13 var sl: i64 = 0 14 while s[sl] != 0 { sl = sl + 1 } 15 return __syscall(93, sl & 0xFF, 0, 0, 0, 0, 0) 16}