code wiki / (root) / nx_smoke_asm_test13.nx

nx_smoke_asm_test13.nx source

↩ module page · 20 lines · 711 B

1// smoke_asm_test13.nx -- sd with memory operand format. 2 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 = "sd ra, 8(sp)\n" 14 let out: *u8 = alloc(64) 15 let n: i64 = assemble(s, 13, out, 64) 16 if n == -2 { return __syscall(93, 202, 0, 0, 0, 0, 0) } 17 if n == -3 { return __syscall(93, 203, 0, 0, 0, 0, 0) } 18 if n < 0 { return __syscall(93, 200, 0, 0, 0, 0, 0) } 19 return __syscall(93, n & 0xFF, 0, 0, 0, 0, 0) 20}