When an assembly has an instruction like jmp f what happens to the stack and frame pointers?
I mean - f is a label in memory right? How can we jump to different address in memory and not update our frame and stack pointers...
EDIT: I am talking about Intel x86 assembly yes :)
The stack and frame pointers deal with location of the data. jmp
instructions deal with location of the code. Unless something drastic happens, one should not affect the other. Here's a list of drastic things:
jmp
that tries to change the privilege illegally. That's about it. Even those cases change the stack because they involve some sort of context switch, either to a new task or to some exception handler.
Note also that no OS that I know of uses the CPU's task switching features. It's usually implemented in software.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With