Stack Pointers Explained - ESP vs EBP in Assembly
3-Second Blueprint (English)
- PUSH and POP save and restore 4-byte register values on the thread stack while automatically adjusting the ESP top-of-stack pointer.
- The EBP base pointer anchors a stable stack frame so functions access passed arguments via positive offsets and locals via negative ones.
- Under cdecl the caller cleans pushed arguments off the stack after return, whereas stdcall delegates stack cleanup to the called function.
ESP & EBP Registersx86 Call StackPUSH & POPcdecl vs stdcall
3-Sekunden-Fazit (Deutsch)
- PUSH und POP sichern und laden 4-Byte-Registerwerte auf dem Thread-Stack und passen den Stack-Pointer ESP dabei automatisch passend an.
- Der Base-Pointer EBP verankert den Stack-Frame, sodass Parameter über positive und lokale Variablen über negative Offsets erreichbar sind.
- Bei cdecl bereinigt der Aufrufer die Stack-Argumente nach der Rückkehr, während stdcall diese Bereinigung der aufgerufenen Funktion überlässt.
ESP- & EBP-Registerx86-AufrufstackPUSH & POPcdecl vs. stdcall
Note / Hinweis: Blueprints are AI-generated educational summaries (0% Politics · 0% Religion · 0% Brainrot) and do not constitute medical, legal, or financial advice. / KI-generierte Zusammenfassung zu Bildungszwecken – ersetzt keine medizinische, rechtliche oder finanzielle Fachberatung.