Overheard: Word of the Day

A Whatis.com blog

» VIEW ALL POSTS Jun 4 2012   2:02PM GMT

Understanding the stack and the role of a stack pointer



Posted by: Margaret Rouse
Tags:
buffers
stacks
“By convention, stacks usually grow down. This means that the stack starts at a high address in memory and progressively gets lower.”Ian Wienand

Today’s WhatIs.com Word of the Day is stack pointer, a small register that stores the address of the program request most recently entered into a stack.

I have to take a minute here to plug Ian Wienand’s free online book “Computer Science from the Bottom Up.”  If you’re interested in looking underneath the hood, this is the book to help you understand what you’re seeing.

Mr. Wienand explains the concept of a stack as clearly as anyone I’ve ever heard or read:

A stack is generic data structure that works exactly like a stack of plates; you can push an item (put a plate on top of a stack of plates), which then becomes the top item, or you can pop an item (take a plate off, exposing the previous plate).

Stacks are fundamental to function calls. Each time a function is called it gets a new stack frame. This is an area of memory which usually contains, at a minimum, the address to return to when complete, the input arguments to the function and space for local variables.

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: