operating-systems

Definition

Stack Pointer

The Stack Pointer (SP) is a CPU register that stores the memory address of the top element of the current stack.

Usage

  • Push: Decrements the pointer (in a downward-growing stack) and writes data to memory.
  • Pop: Reads data from memory and increments the pointer.