Program counter is a 16 bit register. This register is a memory pointer. The function of program counter is to point to the memory location from which the next instruction is to be executed. When a program is to be executed, it is first entered into the memory locations. Now the program counter is loaded by the address of the first instruction to be executed. Once the first instruction is executed, the program counter is automatically incremented to point to the address of next instruction. The process is repeated till the end of the program.
This register is basically deals with the execution of instructions in sequence. Memory locations have 16-bit addresses, and that is why this is a 16-bit register. The microprocessor uses this register to sequence the execution of the instructions. The main function of the program counter is to point to the memory address from which the next byte is to be fetched. When a byte is being fetched the program counter is incremented by one point to the next memory location.
Post a Comment