A program counter is a register in a computer processor that contains the address
(location) of the instruction being executed at the current time. In order for the program counter to move to the next instruction and thus process the entire program, it must be updated or changed at runtime. Pointers are variables that point to the address of where the variable's value is stored, and ONLY POINTERS can be changed at runtime.
Trying to change a normal variable will just result in a FALSE return.
Synonym for Instruction Pointer.
Program Counter is just a synonim for Instruction Pointer.
The stack pointer keeps track of the top of the stack used by the current thread. The program counter keeps track of the next instruction in a program. Both are registers and both store a memory address.
In 8085 program counter stores the address of the next instruction which is to be fecthed.same function is performed by instruction pointer in 8086.
The program counter (PC) and stack pointer (SP) registers are 16-bit registers in the 8085 and in the 8086/8088 because that is how Intel designed the processors.
The program counter (PC) and the stack pointer (SP).
Because that's how Intel designed it. Even though the 8085 is an 8-bit computer, the program counter and stack pointer are 16 bits wide in order to support the address bus, which is also 16 bits wide. In the case of the 8086/8088, the program counter and stack pointer are still 16 bits wide, even though the address bus is 20 bits wide, because the 8086/8088 adds segmentation through the 16 bit segment register which is left shifted by 4.
A stored-program computer at least needs to know which instruction it has to execute next. Other memory addresses of special significance are e.g. the top of one or more stacks, or addresses to be used by instructions.To keep track of such addresses, all CPUs have one or more registers; for instance the address of the next instruction is stored in the instruction pointer, a.k.a. program counter. Which and how many registers of a CPU are designated to keep addresses depends on the CPU type. The Z80 for instance has a program counter, a stack pointer, two index registers and an indirect address register doubling as 16 bit accumulator, while the contemporay 6502 only has a program counter and a stack pointer.
The Program Counter and Stack Pointer registers are called special purpose registers because they can not be used arbitrarily; they are, well, special. You cannot, for instance, load a new value into the Program Counter and blithely continue, that action would cause an unconditional jump. Also, the Program Counter is automatically incremented by the size of the instruction, so you can not just put something in it and expect its value to persist. Similarly, you cannot load a new value into the Stack Pointer without losing the entire stack context that you are in.
Both of them are pointers, but otherwise they are completely unrelated. The former points to the current position of the stack, the latter points to the current instruction of the program.
program counter holds the address of the next instruction.
Program Counter( PC)stores the 16-bit memory address of the next instruction to be fetched. Stack Pointer (SP)stores the address of a memory location which is used as a stack.