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)

  • 相关阅读:
    软件测试的重要性
    软件测试二三事
    白盒测试总结
    黑盒测试总结
    闰年测试以及非法输入的处理方法
    软件测试(3)-基于等价类划分的一个小例子
    第二周课堂小结以及习题思考
    软件测试人员的自身修养
    软件测试的目的和方法
    第七周学习笔记之灰盒测试
  • 原文地址:https://www.cnblogs.com/feng9exe/p/10552307.html
Copyright © 2011-2022 走看看