code wiki / (root) / nx_x86_64_test.nx

nx_x86_64_test.nx

buildroot/runtime/nx_x86_64_test.nx

2332 B67 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic x86
docsdependenciesstructsconstsfunctions

about

nx_x86_64_test.nx -- foundation smoke for the x86_64 emit library. Hand-sequences nx_x86_64 primitives to build a write+exit program asm file, prints it to stdout. The companion bash wrapper then assembles + links + runs the produced binary natively on x86_64. Two layers verified by this smoke: 1. Each emit primitive produces the expected asm text (this file). 2. The asm assembles + runs natively (bench/nx_x86_64_smoke.sh). The hand-built asm is the canonical "hello world" + sys_exit(0).

dependencies 3 imports · 0 importers

syscalls.nx nx_outbuf.nx nx_x86_64.nx nx_x86_64_test.nx

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

main out_new sys_mmap out_str out_char x86_emit_function_start x86_emit_section_text out_str ↻ out_str ↻ out_char ↻ x86_emit_label out_str ↻ out_char ↻ x86_emit_movabsq out_str ↻ out_i64 out_char ↻ sys_mmap ↻ out_char ↻ x86_emit_syscall out_str ↻ x86_emit_function_end out_str ↻ out_char ↻ x86_emit_prologue x86_round_up_16 out_str ↻ out_i64 ↻ x86_emit_syscall_imm x86_emit_movabsq ↻ x86_emit_syscall ↻ x86_emit_leaq_rip out_str ↻ out_char ↻ x86_emit_epilogue out_str ↻ x86_emit_section_rodata out_str ↻ x86_emit_label ↻ x86_emit_asciz

structs

none

consts

none

functions

17func main() -> i64