nxasm_main.nx
buildroot/runtime/nxasm_main.nx
about
nxasm_main.nx -- CLI driver for nxasm_v2 + elf_writer.
Usage: nxasm <input.s> > <output.elf>
Reads input.s via sys_read_file, assembles to RV64 machine
bytes via nxasm_v2.assemble(), wraps in a static Linux ELF
via elf_writer.write_elf(), writes to stdout.
Single-step asm+link. For programs whose entire link is a
single .s file (the common case for nxc.nx output today),
this replaces the entire `gcc-as + ld` chain in verify.sh.
Exit codes:
0 success
1 no args
2 read failed
3 assemble failed (negative byte count)
4 write failed
Together with nxld_main (which handles multi-object link),
these two tools cover every gcc-as + ld invocation we need.
dependencies 3 imports · 0 importers
imports: syscalls.nxnxasm_v2.nxelf_writer.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
| 27 | func main(argc: i64, argv: *i64) -> i64 { |