Stack is a LIFO( Last in, First out) structure implemented in the RAM area and is used to store addresses and data, when the microprocessor branches to a subroutine.
These are two special purpose registers each of 16 bit width.
1. Stack Pointer(SP)
2. Program Counter (PC)
SP is special purpose 16 bit register. It contains a memory address. Suppose SP contents are FC78H, then the 8085 interprets it as follows.
Memory locations FC78H, FC79H…..FFFFH are having useful information. In other words these locations are treated as filled locations.
Memory locations FC77H, FC76H….0000H are not having any useful information. These locations are treated as empty.
Thus the contents of SP specify the top most useful location in the stack. In other words it indicate memory location with the smallest address having useful information.