CPUs and architecture
What does a CPU's program counter (PC) hold?
- AThe address of the next instruction to execute
- BThe total number of instructions executed
- CThe CPU's temperature
Show answer and explanation
Answer: A. The address of the next instruction to execute
The program counter holds the memory address of the next instruction to fetch and execute. It normally advances by the instruction length (e.g., 4 bytes) after each instruction, is overwritten with the target on branches and jumps, and with the handler address on interrupts. On a function call, the address of the instruction after the call is saved to the stack or a link register as the return address.
- A. Correct. It holds the address of the next instruction to execute.
- B. Counting executed instructions is done by performance counters and the like.
- C. Temperature is measured by sensors and is unrelated to the program counter.