nx_emu_cortexm.nx
buildroot/runtime/nx_emu_cortexm.nx
about
nx_emu_cortexm.nx -- sovereign ARMv7-M / Cortex-M (Thumb-2) interpreter (NX-EMU).
Little-endian, MIXED 16/32-bit instructions (32-bit iff hw1[15:11] in {11101,11110,
11111} i.e. hw1>=0xE800), 16 GPRs + C flag. Decodes the subset nxc2's cortex_m
backend emits: push/pop, mov(hi), movs, adds/subs/adcs/sbcs, sub-sp, ldr/str (16-bit
imm5 + 32-bit T4 neg-offset), blx, movw, umull, mla, subw. Bare-metal: BKPT halts
with result=r0 (no OS). NO qemu. 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 CM_GUEST: i64 = 16777216 |
| 10 | const CM_MASK: i64 = 0xFFFFFFFF |
functions
| 12 | func cm_ld(mem: *u8, va: i64, width: i64) -> i64 { var v: i64 = 0; var i: i64 = 0; while i < width { v = v | ((mem[va + i] & 0xff) << (i * 8)); i = i + 1 } return v } called by 1: emu_cortexm_run_mem |
| 13 | func cm_st(mem: *u8, va: i64, width: i64, val: i64) -> i64 { var i: i64 = 0; while i < width { mem[va + i] = (val >> (i * 8)) & 0xff; i = i + 1 } return 0 } called by 1: emu_cortexm_run_mem |
| 15 | func emu_cortexm_run_mem(mem: *u8, mem_size: i64, entry: i64, sp0: i64) -> i64 |
| 162 | func emu_cortexm_run(code: *u8, code_len: i64) -> i64 calls 1: emu_cortexm_run_mem |