code wiki / (root) / nx_x86_dos_gate.nx

nx_x86_dos_gate.nx

buildroot/runtime/nx_x86_dos_gate.nx

3955 B79 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic x86
docsdependenciesstructsconstsfunctions

about

nx_x86_dos_gate.nx -- R1.1: run a REAL DOS .COM on the sovereign x86 emulator. Hello-World program: B4 09 MOV AH,09h (DOS print-string function) BA 0B 01 MOV DX,0x010B (offset of the $-terminated string) CD 21 INT 21h -> prints "Hello, World!" into the console buffer B4 4C MOV AH,4Ch (terminate) CD 21 INT 21h -> sets the exit flag -> emulator halts 0x10B: "Hello, World!$" Proves 8-bit reg moves (B0+r) + INT (CD) + the HLE DOS INT 21h handler -> an actual program produces output.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_x86.nx nx_gate_verdict.nx nx_x86_dos_gate.nx

imports: nx_syscalls.nxnx_x86.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write sys_mmap x86_reset x86_load x86_run x86_step x86_setzsf x86_modrm x86_rm_set x86_wr16 x86_rm_get x86_rd16 x86_set_r8 x86_dos_int21 x86_fs_nameeq x86_con_len sys_write ↻ g_pn sys_mmap ↻ sys_write ↻ g_check g_puts ↻ x86_con_byte x86_reg gv_ctr sys_mmap ↻ gv_verdict gv_puts sys_write ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap gv_journal sys_openat_append sys_mmap ↻ gv_catn sys_mmap ↻

structs

none

consts

none

functions

13func g_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 2: g_checkmain calls 1: sys_write
14func g_pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
28func g_check(name: *u8, cond: i64) -> i64
called by 1: main calls 1: g_puts
34func main() -> i64