code wiki / (root) / nx_x86_64_loadstore_test.nx

nx_x86_64_loadstore_test.nx

buildroot/runtime/nx_x86_64_loadstore_test.nx

3765 B100 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic x86
docsdependenciesstructsconstsfunctions

about

nx_x86_64_loadstore_test.nx -- session 2 smoke for load/store/GEP. Hand-builds a program that: 1. allocates a 32-byte stack buffer via subq $32, %rsp 2. stores a sequence of bytes into the buffer via different store widths (movb / movw / movl / movq) 3. loads them back via the corresponding load widths with the expected sign-extension behaviour 4. computes an expected output via a couple of adds, then writes the result via sys_write Test value: write the byte 'X' (0x58) to stdout, then exit 0. - movb $0x58, -1(%rbp) ; store byte - movzbq -1(%rbp), %rsi ; load unsigned byte into address-form We adapt: build a small in-stack buffer "X\n" and write 2 bytes.

dependencies 3 imports · 0 importers

syscalls.nx nx_outbuf.nx nx_x86_64.nx nx_x86_64_loadstore_test.nx

imports: syscalls.nxnx_outbuf.nxnx_x86_64.nx

imported by: nobody (leaf or entry point)

structs

none

consts

none

functions

21func main() -> i64