e01.org

Program counter

computer introduced in 1952. Lights in the middle display the contents of various registers. The instruction counter is at the lower left. A program counter (PC) is a register that stores where a computer program is being executed by a processor. It is also commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer. Usually, a PC stores the memory address of an instruction. Further, it usually is incremented after fetching an instruction, and therefore points to the next instruction to be executed. For a processor that increments before fetch, the PC points to the instruction being executed. In some processors, the PC points some distance beyond the current instruction. For instance, in the ARM7, the value of PC visible to the programmer reflects instruction prefetching and reads as the address of the current instruction plus 8...

computer introduced in 1952. Lights in the middle display the contents of various registers. The instruction counter is at the lower left. A program counter (PC) is a register that stores where a computer program is being executed by a processor. It is also commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR), the instruction counter, or just part of the instruction sequencer. Usually, a PC stores the memory address of an instruction. Further, it usually is incremented after fetching an instruction, and therefore points to the next instruction to be executed. For a processor that increments before fetch, the PC points to the instruction being executed. In some processors, the PC points some distance beyond the current instruction. For instance, in the ARM7, the value of PC visible to the programmer reflects instruction prefetching and reads as the address of the current instruction plus 8 in ARM State, or plus 4 in Thumb State. For modern processors, the location of execution in the program is complicated by instruction-level parallelism and out-of-order execution. By default, a processor fetches instructions sequentially from memory, but a control transfer instruction changes the sequence by writing a value in the PC. A branch allows the next instruction to be fetched from elsewhere in memory. A function call not only branches but saves the value of the PC. A return restores the value of the PC to resume execution with the instruction following the call by branching to the saved value. A transfer that is conditional on the truth of some condition lets the computer follow a different sequence under different conditions.

References

  1. ^ "ARM7TDMI (Rev3) Reference manual" . ARM Limited . 2001 . Retrieved 2026-01-05 . Wikipedia revision 1352557684, retrieved 2026-11-18 · 1767567600.0
  2. ^ Arnold, Alfred (2020) [1996, 1989]. "E. Predefined Symbols" . Macro Assembler AS – User's Manual . V1.42. Translated by Arnold, Alfred; Hilse, Stefan; Kanthak, Stephan; Sellke, Oliver; De Tomasi, Vittorio. p. Table E.3: Predefined Symbols – Part 3. Archived from the original on 2020-02-28 . Retrieved 2020-02-28 . 3.2.12. WRAPMODE […] AS will assume that the processor's program counter does not have the full length of 16 bits given by the architecture, but instead a length that is exactly sufficient to address the internal ROM. For example, in case of the AT90S8515 , this means 12 bits, corresponding to 4 Kwords or 8 Kbytes. This assumption allows relative branches from the ROM's beginning to the end and vice versa which would result in an out-of-branch error when using strict arithmetics. Here, they work because the carry bits resulting from the target address computation are discarded. […] In case of the abovementioned AT90S8515, this option is even necessary because it is the only way to perform a direct jump through the complete address space […] Wikipedia revision 1352557684, retrieved 2026-11-18 · 1582844400.0
  3. ^ C. Gordon Bell and Allen Newell (1971), Computer Structures: Readings and Examples , McGraw-Hill Book Company , New York, USA Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  4. ^ F. B. Chambers, D. A. Duce and G. P. Jones (1984), Distributed Computing , Academic Press , Orlando, USA, ISBN 0-12-167350-2 Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  5. ^ a b Hayes, John P. (1978). Computer Architecture and Organization . McGraw-Hill. p. 245. ISBN 0-07-027363-4 . Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  6. ^ John L. Hennessy and David A. Patterson (1990), Computer Architecture: a quantitative approach , Morgan Kaufmann Publishers , Palo Alto, USA, ISBN 1-55860-069-8 Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  7. ^ Douglas Hofstadter (1980), Gödel, Escher, Bach: an eternal golden braid , Penguin Books , Harmondsworth, UK, ISBN 0-14-005579-7 Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  8. ^ Principles of Operation, Type 701 and Associated Equipment (PDF) . IBM . 1953. Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  9. ^ Harry Katzan (1971), Computer Organization and the System/370 , Van Nostrand Reinhold Company , New York, USA, LCCCN 72-153191 Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  10. ^ Mead, Carver ; Conway, Lynn (1980). Introduction to VLSI Systems . Reading, USA: Addison-Wesley . ISBN 0-201-04358-0 . Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  11. ^ B. Randall (1982), The Origins of Digital Computers , Springer-Verlag , Berlin, D Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  12. ^ Silberschatz, Abraham ; Gagne, Greg; Galvin, Peter B. (April 2018). Operating System Concepts . United States: Wiley . pp. 27, G-29. ISBN 978-1-119-32091-3 . Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  13. ^ Walker, B. S. (1967). Introduction to Computer Engineering . London, UK: University of London Press . ISBN 0-340-06831-0 . Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
  14. ^ Bates, Martin (2011). "Microcontroller Operation". PIC Microcontrollers . Elsevier. pp. 27– 44. doi : 10.1016/b978-0-08-096911-4.10002-3 . ISBN 978-0-08-096911-4 . Program Counter (PC) is a register that keeps track of the program sequence, by storing the address of the instruction currently being executed. It is automatically loaded with zero when the chip is powered up or reset. As each instruction is executed, PC is incremented (increased by one) to point to the next instruction. Wikipedia revision 1352557684, retrieved 2026-11-18 · 1794956400.0
source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Program counter". 1777926987. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1352557684

JSON record · API collection · citation policy