Home > Common Problem > body text

What is stored in the program counter pc

藏色散人
Release: 2020-05-06 11:24:05
Original
25202 people have browsed it

What is stored in the program counter pc

#What is stored in the program counter pc?

The program counter pc stores the "instruction address".

The program counter PC is used to store the address of the next instruction to be executed. It controls the execution order of the program.

Related introduction:

The program counter is used to store the address of the unit where the next instruction is located.

When executing an instruction, the instruction first needs to be fetched from the memory to the instruction register according to the instruction address stored in the PC. This process is called "instruction fetching". At the same time, the address in the PC is either automatically incremented by 1 or the address of the next instruction is given by the branch pointer. After that, the instructions are analyzed and executed. Complete the execution of the first instruction, and then fetch the address of the second instruction according to the PC, and so on, executing each instruction.

The program counter is a register in a computer processor that contains the address (location) of the instruction currently being executed. As each instruction is fetched, the program counter's memory address is incremented by one. After each instruction is fetched, the program counter points to the next instruction in the sequence. When the computer is restarted or reset, the program counter usually returns to zero.

The above is the detailed content of What is stored in the program counter pc. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!