Avatar of JRPrakash
JRPrakash

asked on 

ESP, EBP pointer in stack manipulation

I often confused with the list of data that is pused into the stack frame when function is invoked.
As for as i know, return address, local variables, parameters are pushed into stack frame. But what i would like to know is the concrete details. Could someone provide ?
Linux OS DevC

Avatar of undefined
Last Comment
evilrix
Avatar of JRPrakash
JRPrakash

ASKER

Hi Experts,
Can someone give a comment on it ?.  :)
Avatar of noci
noci

My guess is, that this is a homework type question so you need to cosult more info for some details.
Pointers to it use are:

SP (ESP for 32bit, RSP for 64bit) is the stackpointer ie. it points to the top of the stack.
  - PUSH AX ==> in microcode = STACK[++SP]=AX

BP is used as a frame pointer most common use at procedure entry:
    PUSH BP
    MOV SP,BP

Now BP can be used to access parameters & local variables.
For more details consult your compilers manual. It's use is language/compiler specific.

ASKER CERTIFIED SOLUTION
Avatar of HappyCactus
HappyCactus
Flag of Italy image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of JRPrakash
JRPrakash

ASKER

Dont we maintain any documentation inside for such a generic questions ?
Avatar of evilrix
evilrix
Flag of United Kingdom of Great Britain and Northern Ireland image

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
C
C

C is a general-purpose, imperative computer programming language, supporting structured programming, lexical variable scope and recursion, while a static type system prevents many unintended operations. By design, C provides constructs that map efficiently to typical machine instructions, so it has found lasting use in applications that had formerly been coded in assembly language, including operating systems as well as various application software for computers ranging from supercomputers to embedded systems. It is distinct from C++ (which has its roots in C) and C#, and many later languages have borrowed directly or indirectly from C.

23K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo