Suppose that I have these two consecutive x64 instructions (running under Windows platform):
ADD RSP, 8
MOV RAX, QWORD PTR [RSP - 8]
As you see it's the equivalent to POP RAX. The location of [RSP - 8] is not allocated anymore and I'm accessing to it!!
- Can I expect that value at
[RSP - 8]not to be altered by a system interrupt or Windows?
I mean, can something happen (interrupt, context switch....) between the execution of those two instructions that modified the content of RSP - 8, so the MOV RAX, [RSP - 8] will read a garbage value?
- What if those two runs in a device driver? Does the same apply?