code wiki / (root) / smoke_asm_test9.nx

smoke_asm_test9.nx source

↩ module page · 13 lines · 424 B

1// smoke_asm_test9.nx -- empty source. 2 3import "syscalls.nx" 4import "nxasm_v2.nx" 5 6func main() -> i64 { 7 let out: *u8 = alloc(64) 8 let n: i64 = assemble(0 as *u8, 0, out, 64) 9 if n == -2 { return __syscall(93, 202, 0, 0, 0, 0, 0) } 10 if n == -3 { return __syscall(93, 203, 0, 0, 0, 0, 0) } 11 if n < 0 { return __syscall(93, 200, 0, 0, 0, 0, 0) } 12 return __syscall(93, n & 0xFF, 0, 0, 0, 0, 0) 13}