Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ESP

Status
Not open for further replies.

TexFlex

Programmer
Feb 12, 2008
9
If I have the directive:
.stack 1000h

How to I initialize the stack or how do I determine the ESP.

Thank you.
Texflex
 
Code:
.stack     1000h

This defines a stack for the program of 1000h bytes (or 4096 bytes). There really is not a need to initialize the stack, unless you want it to show up on a memory dump.

ESP is the stack pointer, which points at the other end of the stack and moves towards the base stack register when things are added to the stack.

Generally, though, you shouldn't have much (not any, though, there is a case or two I know of) need for touching the stack pointer or the stack base pointer. The stack is generally considered for temporary storage, has rules for how it is handled (FIFO), and instructions for handling it (PUSH, POP among others). So there isn't that much to worry about unless you need to do what is required in that case or two I mentioned.

----------
Measurement is not management.
 
Thank you for the answer. Something in my reading was confusing, but I did have the right answer.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top