zoukankan      html  css  js  c++  java
  • 指令计数器--Program counter

    别名:指令指针、指令地址寄存器、程序计数器;

    操作:顺序操作(计数器加一)、分支操作(计数器修改);

    The program counter (PC), commonly called the instruction pointer (IP) in Intel x86 and Itanium microprocessors, and sometimes called the instruction address register (IAR),[1] the instruction counter,[2] or just part of the instruction sequencer,[3] is a processor register that indicates where a computer is in its program sequence.[note 1]

    In most processors, the PC is incremented after fetching an instruction, and holds the memory address of ("points to") the next instruction that would be executed.

    Processors usually fetch instructions sequentially from memory, but control transfer instructions change the sequence by placing a new value in the PC. These include branches (sometimes called jumps), subroutine calls, and returns. A transfer that is conditional on the truth of some assertion lets the computer follow a different sequence under different conditions.

    A branch provides that the next instruction is fetched from elsewhere in memory. A subroutine call not only branches but saves the preceding contents of the PC somewhere. A return retrieves the saved contents of the PC and places it back in the PC, resuming sequential execution with the instruction following the subroutine call.

    https://en.wikipedia.org/wiki/Program_counter

    Branch (computer science)

    Mechanically, a branch instruction can change the program counter (PC) of a CPU. The program counter stores the memory address of the next instruction to be executed. Therefore, a branch can cause the CPU to begin fetching its instructions from a different sequence of memory cells.

    When a branch is taken, the CPU's program counter is set to the argument of the jump instruction. So, the next instruction becomes the instruction at that address in memory. Therefore, the flow of control changes.

    When a branch is not taken, the CPU's program counter is unchanged. Therefore, the next instruction executed is the instruction after the branch instruction. Therefore, the flow of control is unchanged.

    https://en.wikipedia.org/wiki/Branch_(computer_science)

  • 相关阅读:
    周末给女友讲了遍加密算法,没想到...
    gradle执行打包并导出Apk到指定文件夹
    功能算法
    位运算之异或运算
    禁止ViewPager滑动
    macOS 去掉系统软件更新红点提示
    【转】Kotlin的inline内联函数
    Android Gradle Plugin v3.6.0/3.6.1 构建Bug
    IntelliJ IDEA UML插件
    【LeetCode 1. Two Sum】
  • 原文地址:https://www.cnblogs.com/feng9exe/p/10552307.html
Copyright © 2011-2022 走看看