code wiki / (root) / nx_iot_sc_emit_a64.nx

nx_iot_sc_emit_a64.nx

buildroot/runtime/nx_iot_sc_emit_a64.nx

5404 B114 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic iot
docsdependenciesstructsconstsfunctions

about

nx_iot_sc_emit_a64.nx -- SOVEREIGN emitter: NishiLang -> aarch64 .s for the SmartConfig broadcaster that runs ON the GL.iNet router (the 2.4GHz AP). The "send-loop shortcut": the complex ENCODING runs here on x86 (reusing the GATED nx_sc_encode), and only the small SEND-LOOP is emitted as ARM asm to be assembled by nxasm_arm64_main + deployed via routerfix. No full aarch64 compiler needed. Emits (to stdout): socket(AF_INET,DGRAM) -> SO_BROADCAST -> sockaddr (subnet-directed broadcast 192.168.10.255:7001 -> routes out the IoT bridge onto the 2.4GHz air) -> an OUTER repeat loop over the U8 length sequence, each length sent as a UDP packet via a `snd` subroutine (sendto + 5ms nanosleep). Uses ONLY assembler-supported A64 ops (movz/movk/str/add/sub/mov/cmp/b.lt/bl/ret/svc). aarch64 syscalls (asm-generic): socket=198 setsockopt=208 sendto=206 nanosleep=101 exit=93. NEVER-BRICK #26: emits reversible Wi-Fi creds only. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_iot_smartconfig.nx nx_syscalls_x86_64.nx nx_iot_sc_emit_a64.nx

imports: nx_iot_smartconfig.nxnx_syscalls_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 nx_sc_encode nx_sc_crc8 nx_sc_crc8_upd nx_sc_emit_dc nx_sc_crc8_upd ↻ e_line e_w e_nl e_w ↻ e_n e_nl ↻

structs

none

consts

14const K_MAGIC_5000000: i64 = 5000000

functions

16func e_w(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 2: e_linemain
17func e_nl() -> i64 { let b: *u8 = sys_mmap(1); b[0] = 10 as u8; sys_write(1, b, 1); return 0 }
called by 2: e_linemain
18func e_n(v: i64) -> i64
called by 1: main
27func e_line(s: *u8) -> i64 { e_w(s); e_nl(); return 0 }
called by 1: main calls 2: e_we_nl
29func main() -> i64