First post, by superfury
When executing a POP SP or POP ESP, what's in the resulting stack pointer(ESP) register?
The documentation says (E)SP is incremented after reading it, so that would mean that (E)SP is loaded from the bottom of the stack, and that value that's read is incremented by 2 or 4. So (E)SP actually contains 2 or 4 more than what was originally pushed(on a 386+, since it pushes the original value before pushing)? Or, since it's popping, the increase doesn't happen to the result((E)SP value)?
Edit: So in other words, what happens when you execute in a program:
MOV SP,FFFC
PUSH SP
POP SP
MOV ESP,FFFFFFFC
PUSH ESP
POP ESP
(assuming the compiler doesn't optimize it away) What is the resulting value in (E)SP in those two cases?
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io