I am looking at x86-64 ISA, and the leaq
instruction is used to load the address to a designated register and I am looking at the following example:
long m12(long x){
return x *12;
}
which is equivalent to
leaq (%rdi, %rdi, 2), %rax
salq $2, %rax
I vaguely get what it means here is that leaq
does not reference the memory location given by the computed "address", instead it relocates the computed "address" directly. However, %rdi
just holds an integer. How is that an address in any sense?