I am new to x86 assembly and I have a question regarding the movq and leaq instruction. In particular, I would like to know the difference between the following:
1. movq (%rax), %rcx
2. movq %rax, %rcx
3. leaq (%rax), %rcx
4. leaq %rax, %rcx
I am assuming that for 1. the value in the %rax register will be interpreted as a memory access and the value at that memory location will be written into the %rcx register. But what about 2. ? Will the value in the %rax register just directly be written into the %rcx register without accessing memory ? Regarding 3. and 4. I am clueless and not even sure if there is a difference as I know that lea does not access memory and just calculates an address.