nx_emu_riscv32.nx
buildroot/runtime/nx_emu_riscv32.nx
about
nx_emu_riscv32.nx -- sovereign RV32IM interpreter (NX-EMU, 32-bit XLEN).
Sibling of nx_emu_rv64 for the 32-bit RISC-V target; nxc2's rv32 backend
represents i64 as register PAIRS, so the KAT exercises add/sub/mul/mulhu/sltu
(carry) over 32-bit lanes. Flat little-endian guest RAM, Linux rv32 syscalls
(exit=93, a7=num, a0..=args). NO qemu -- decode/execute per the RISC-V ISA.
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls_x86_64.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 9 | const R32_GUEST: i64 = 16777216 |
| 10 | const R32_MASK: i64 = 0xFFFFFFFF |
| 11 | const R32_SYS_EXIT: i64 = 93 |
functions
| 13 | func r32_ld(mem: *u8, va: i64, width: i64) -> i64 called by 1: emu_riscv32_run_mem |
| 19 | func r32_st(mem: *u8, va: i64, width: i64, val: i64) -> i64 called by 1: emu_riscv32_run_mem |
| 24 | func r32_sx(v: i64, bits: i64) -> i64 { let m: i64 = 1 << (bits - 1); if (v & m) != 0 { return v - (1 << bits) } return v } called by 1: emu_riscv32_run_mem |
| 26 | func emu_riscv32_run_mem(mem: *u8, mem_size: i64, entry: i64, sp0: i64) -> i64 |
| 105 | func emu_riscv32_run(code: *u8, code_len: i64) -> i64 calls 1: emu_riscv32_run_mem |