Jump to content

Stack pointer

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 12.216.162.129 (talk) at 13:34, 10 March 2002. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

A common implementation of the stack data structure uses, in addition to a block of memory to hold the data in the stack, a value that points to the most-recently pushed datum. The place that value is kept is called the stack pointer.

Many CPUs have registers that can be used as stack pointers. Some, like the x86, have special instructions that implicitly use a register dedicated the job of being a stack pointer. Others, like the PDP-11 and the 68000 family have addressing modes that make it possible to use any of a set of registers as a stack pointer.