Describe the functions of stack pointer and program counter of 8085.
Stack pointer:
1. It is a 16 bit register which is used to store the address of topmost filled memory location of stack memory.
2. SP always points current top of stack.
3. If data is stored in stack memory, the content of stack pointer is auto-decremented by two and if data is picked out from stack memory, the content of SP is auto-incremented by two.
Program counter:
1. It maintains sequential execution of program written in memory.
2. The PC stores the address of the next instruction which is going to execute.
3. Since program counter stores the address of memory and in 8085 the address of memory is 16 bit. Hence program counter is 16 bit register.