Just a note: there are many kinds of "jmp" commands in x86. The most common is the "local" jmp, which simply changes the value of the EIP register, so the stack frame is not affected at all, as Karl pointed out. I assume that you are talking about this type of jmp, as this is the one that collectors generate with syntax like:
jmp label ... label:
But there is a โdistantโ jump, which also affects the CS segment register. If the processor is in real mode, it is still nothing but changing the CS: IP registers (just a โbigโ transition), but in protected mode the CS segments have a completely different and much more complex function: it is interpreted as a handle to the CALL / gates TASK / INTERRUPT, that is, an index in a descriptor table that defines many things, such as a privilege level, a task ... Depending on a particular descriptor, an escalation of the privilege level or the โhardware taskโ switch can occur. This can lead to a change in context. Usually you will not find transitions in protected mode unless you program the kernel of the operating system. Creating segment descriptors is almost always the job of the kernel.
Hi
source share