I'm trying to output the top value on the stack (here it is "6"). But I get garbage. Am I missing something ?
push rax
mov rax, 1 ; 'write' syscall number
mov rdi, 1 ; stdout descriptor
mov rsi, rsp ; rsp is the address where number "6" is stored by "push rax" before
mov rdx, 1 ; string length
syscall