code wiki / (root) / nx_x86_64_arith_test.nx

nx_x86_64_arith_test.nx

buildroot/runtime/nx_x86_64_arith_test.nx

2356 B69 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic x86
docsdependenciesstructsconstsfunctions

about

nx_x86_64_arith_test.nx -- session 4 smoke for mul/div/shift/bitwise. Computes ((7 * 6) - 30) / 4 = 3 entirely on the x86_64 stack machine, ASCII-encodes the result (0x30 + 3 = '3') and writes one byte to stdout. Validates imulq + subq + cqo + idivq. Then ALSO does: (0xFF & 0x0F) | 0x40 = 0x4F = 'O' -- and/or (5 ^ 3) << 1 = 12 -> '<' -- xor/shlq_imm not(~0xFFFFFFFFFFFFFFFB) = 5 -> '5' -- notq + neg But the SMOKE asserts ONLY the first one to keep things minimal. Stdout: "3" (one byte 0x33).

dependencies 3 imports · 0 importers

syscalls.nx nx_outbuf.nx nx_x86_64.nx nx_x86_64_arith_test.nx

imports: syscalls.nxnx_outbuf.nxnx_x86_64.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

18func main() -> i64