Academy - Intro to Assembly - Data Movement Question

Stuck on this question. "Add an instruction at the end of the attached code to move the value in “rsp” to “rax”. What is the hex value of “rax” at the end of program execution? "

I tried adding “mov rax, rsp”, didn’t work.
tried “mov rax, [rsp]”, didn’t work.
also tried “lea rax, rsp”, still didn’t work. I can’t figure it out.

I got the correct answer

1 Like

Hello.
can you help me with this. I dont know what to do next.

this is the code i writed:

global _start

section .text
_start:
mov rax, 1024
mov rbx, 2048
xchg rax, rbx
push rbx
mov rax, [rsp]

Best regards

did you solve this? i have problems with this exercise.