Page 2 of 2

Re: ESP and EBP change not committed after return from inter

Posted: Fri Aug 24, 2012 12:37 pm
by DirectXtreme
Ok, I have multitasking working!!! I can switch between tasks but if the task includes a call to a function my OS crashes with a Exception but this is due to invalid register values. The only reason I can think of is the fact that it tries to pop values back off the stack but ESP points to an incorrect location.

Re: ESP and EBP change not committed after return from inter

Posted: Fri Aug 24, 2012 1:28 pm
by Owen
Nable wrote:
You can simply discard it (increase ESP by 4 instead of popping anything).
AFAIK, it can be a bad idea if you care about performance: CPU's out-of-order and other execution units like when what pairs of call/ret, push/pop, interrupt/iret are balanced.
call/ret, yes. push/pop, no. interrupt/iret, I doubt they're common enough for them to care about (also, both cases are microcode monstrosities)