my question is: When I have something like this:
lea rax, rbp - 8
// Maybe that's an int on my stack, because I have a local "int"-variable in my code. How does the CPU know, where the data is, when I do this:
mov qword [rax], 14
I mean, it's just an address... What if I had reserved memory at 2^64 - x
?
Cant your allocated memory have this kind of address?
Or what if the stack grew until it has the same addresses as your allocated memory?
Does that happen?
The Assembler doesn't know what the number in rax is, so it can't be a MOVstack and a MOVheap, like with near and far JMPs.