Program counter

Program counter

The program counter, or shorter PC (also called the instruction pointer, part of the instruction sequencer in some computers) is a register in a computer processor which indicates where the computer is in its instruction sequence. Depending on the details of the particular machine, it holds either the address of the instruction being executed, or the address of the next instruction to be executed. The program counter is automatically incremented for each instruction cycle so that instructions are normally retrieved sequentially from memory. Certain instructions, such as branches and subroutine calls and returns, interrupt the sequence by placing a new value in the program counter.

In most processors, the instruction pointer is incremented immediately after fetching a program instruction; this means that the target address of a branch instruction is obtained by adding the branch instruction's operand to the address of the next instruction (byte or word, depending on the computer type) after the branch instruction. The address of the next instruction to be executed is always found in the instruction pointer.

The basic model (non von Neumann) of Reconfigurable Computing systems, however, uses data counters instead of a program counter.

Program Counters almost always point to the NEXT instruction or address to be executed. There are rare processors/occasions where it points to the current address being executed. The program counter was developed as a means for the programmer to keep track of where the processors next execution is, making it easier to debug programs. Some programmers reference to program counter as the data counter. Both terms are correct, however, the term program counter is more accurate because it points to the next address (Memory Location) to be executed where data is going to be altered or stored.

Some assembly language programmers use the "NOP" or "NOOP" meaning No Operation as a reference for an important address that the program counter points to. This is an old programming technique but is still used today by some programmers.

ee also

* Central processing unit


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • program counter — komandų skaitiklis statusas T sritis automatika atitikmenys: angl. command counter; control counter; control register; instruction address register; instruction counter; operation address register; program counter; program address counter;… …   Automatikos terminų žodynas

  • Program Counter — Der Programmschrittzähler oder auch Befehlszähler (engl. program counter, kurz PC oder instruction pointer, kurz IP) ist ein spezielles Register innerhalb der CPU eines Computers, das je nach Systemarchitektur die Speicheradresse des derzeitigen… …   Deutsch Wikipedia

  • Program counter — Der Programmschrittzähler oder auch Befehlszähler (engl. program counter, kurz PC oder instruction pointer, kurz IP) ist ein spezielles Register innerhalb der CPU eines Computers, das je nach Systemarchitektur die Speicheradresse des derzeitigen… …   Deutsch Wikipedia

  • program counter — programos skaitiklis statusas T sritis informatika apibrėžtis ↑Centrinio procesoriaus ↑registras (3), kuriame laikomas tolesnės komandos ↑adresas. Kai baigiama vykdyti komanda, tolesnė komanda imama iš skaitiklio rodomo adreso, o programos… …   Enciklopedinis kompiuterijos žodynas

  • program counter — noun A register that stores the address of the current (or next) instruction to be carried out by the processor. Syn: instruction pointer …   Wiktionary

  • program counter — register that stores the number of the next command to be performed …   English contemporary dictionary

  • program-address counter — komandų skaitiklis statusas T sritis automatika atitikmenys: angl. command counter; control counter; control register; instruction address register; instruction counter; operation address register; program counter; program address counter;… …   Automatikos terminų žodynas

  • Counter-recruitment — is a strategy often taken up to oppose war. Counter recruitment is an attempt to prevent military recruiters from enlisting civilians into the military. There are several methods commonly utilized in a counter recruitment campaign, ranging from… …   Wikipedia

  • Counter-Strike: Source — Developer(s) Valve Corporation Hidden Path Entertainment (develops updates since mid 2010[1] and will continue even after the release of …   Wikipedia

  • Counter-Revolutionary Violence — Bloodbaths in Fact Propaganda   Author(s) Edward S. Herman …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”