nx_x86_64_loadstore_test.nx
buildroot/runtime/nx_x86_64_loadstore_test.nx
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
imports: syscalls.nxnx_outbuf.nxnx_x86_64.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 21 | func main() -> i64 |