global _start section .bss mystack resb 100 section .text _start: mov rax, 1 push rax mov rax, 2 push rax ; Stack exchange mov r10, rsp ; save stack pointer mov rsp, mystack ; load our custom stack's address into rsp. mov rax, 3 push rax mov rax, 4 push rax ; Stack exchange mov r11, rsp ; save stack pointer into data register r10 mov rsp, r10 ; load our custom stack's address into rsp. pop rbx pop rbx pop rbx mov r10, rsp ; save stack pointer mov rsp, r11 ; load our custom stack's address into rsp. pop rbx pop rbx ;exits program mov rax, 60 mov rdi, 0 syscall