Stack

From CDOT Wiki
Revision as of 13:14, 8 January 2014 by Chris Tyler (talk | contribs) (Created page with 'Category:Computer Architecture A ''stack'' is an array where values are added (pushed) or removed (pulled) to/from the end of the array only. Most CPU designs incorporate one…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A stack is an array where values are added (pushed) or removed (pulled) to/from the end of the array only. Most CPU designs incorporate one or more hardware-managed stacks which are used to store and restore state information during subroutine calls, exceptions, and interrupts.

Hardware stacks are implemented through the use of a stack pointer register, which is used for indirect read/writes, with the stack pointer automatically incremented or decremented on each access. On some architectures, the stack grows downward in memory; in others, it grows upward.