What is a program counter? What is its use?

Answer Posted / amita

The program counter, or PC (also called the instruction pointer[1], or instruction address register[2], or just part of the instruction sequencer[3] in some computers) is a processor register that indicates where the computer is in its instruction sequence. Depending on the details of the particular computer, the PC holds either the address of the instruction being executed, or the address of the next instruction to be executed.
In most processors, the instruction pointer is incremented automatically after fetching a program instruction, so that instructions are normally retrieved sequentially from memory, with certain instructions, such as branches, jumps and subroutine calls and returns, interrupting the sequence by placing a new value in the program counter.
Such jump instructions allow a new address to be chosen as the start of the next part of the flow of instructions from the memory. They allow new values to be loaded (written) into the program counter register. A subroutine call is achieved simply by reading the old contents of the program counter, before they are overwritten by a new value, and saving them somewhere in memory or in another register. A subroutine return is then achieved by writing the saved value back in to the program counter again.

Is This Answer Correct ?    29 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lst file?

669


Explain what is sim and rim instructions?

665


Explain the purpose of the status register?

628


Describe the aaa instruction with the help of an example?

556


How many instruction bits does 8085 processor support?

601






What is the difference between isr & function call?

546


Byte wise what are the lengths of call and ret instructions?

781


List the various registers of 8085?

669


what is logical address?

565


Describe the accumulator register of 8085?

586


Mention the addressing modes of 8085?

650


write the assembly language programming to find the 2's complement for a string of 100 bytes

731


List out addressing modes in mcs-51?

702


Why the temporary registers w and z are named so I mean we start from a,b,c,d,e then h and l coz h stands for higher bit nd l for lower bit of the address pinted by memory pointer....but wats w and z for?

544


What is 8051 microcontroller ?

628