nx_x86_64_call_test.nx
buildroot/runtime/nx_x86_64_call_test.nx
about
nx_x86_64_call_test.nx -- session 5 smoke for call / return.
Builds a program with two functions:
func writer():
write(1, "K", 1) ; emits 'K' to stdout (side effect)
return 7 ; returns 7 in rax
func main():
call writer ; rax = 7 after return
rax += 0x30 ; rax = 0x37 ('7')
write(1, &rax_byte, 1) ; emits '7'
ret 0
Expected stdout: "K7" (hex 4B 37) -- proves:
- call dispatches to writer
- writer's write side effect happens
- writer's return value (7) propagates via rax
- main consumes the return value and uses it
dependencies 3 imports · 0 importers
imports: syscalls.nxnx_outbuf.nxnx_x86_64.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 25 | func main() -> i64 |