code wiki / (root) / nx_pe_compile_win_dll.nx

nx_pe_compile_win_dll.nx

buildroot/runtime/nx_pe_compile_win_dll.nx

10456 B169 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind tooltopic pe
docsdependenciesstructsconstsfunctions

about

nx_pe_compile_win_dll.nx -- compiler->DLL: wrap REAL nx_cc-compiled NishiLang in a PE DLL with named exports, incl. an MS-x64->SysV ABI thunk (up to 4 int args) so exported functions that take arguments work. Assembles the .s nx_cc emitted (reuse nxasm_x86 axc_pass, NO shared edit), resolves export offsets, appends the thunk, emits a 2-export DLL. Exports: nishi_answer (direct no-arg) + nishi_render(buf,w,h) (via thunk) -- a real rasterizer a foreign Windows process calls to get a rendered frame in a caller-provided buffer = "a game calls our sovereign d3d-lib and gets pixels". Code is position-independent (immediate/rel32) -> no .reloc; based 0x180000000. cl/WARP = oracles only; DLL = 100% NishiLang. Input: /tmp/nishi_export_lib.s Output: knowledge/nishi_compiled.dll license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nxasm_x86.nx nx_pe_writer.nx nx_pe_compile_win_dll.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnxasm_x86.nxnx_pe_writer.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main pcwd_puts sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_exit pcwd_assemble_exports sys_mmap ↻ axc_pass axc_is_space axc_is_ident axc_apply_section axc_tok_is axc_cstr_len axc_is_space ↻ axc_is_ident ↻ axc_tok_is ↻ axc_emit_bytes axc_is_digit axc_parse_int axc_is_digit ↻ axc_parse_operand axc_is_space ↻ axc_is_ident ↻ axc_reg_num axc_tok_is ↻ axc_parse_int ↻ axc_is_digit ↻ axc_tok_is ↻ axc_emit axc_tok_is ↻ axc_alu x86_alu_imm x86_rex_w x86_modrm

structs

none

consts

none

functions

13func pcwd_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main calls 1: sys_write
18func pcwd_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
19func pcwd_wstr(buf: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ buf[off+i]=s[i]; i=i+1 } buf[off+i]=0 as u8; return i+1 }
called by 1: pcwd_emit_dll
21func pcwd_assemble_exports(src: *u8, n: i64, out: *u8, out_cap: i64, p0: *i64, l0: *u8, p1: *i64, l1: *u8) -> i64
61func pcwd_emit_dll(buf: *u8, code: *u8, code_len: i64, answer_off: i64, render_off: i64) -> i64
131func main() -> i64