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

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

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)

指令计数器--Program counter的更多相关文章

  1. SAP computer之program counter

    Program counter The program is stored in memory with the first instruction at binary address 0000, t ...

  2. JVM之PC寄存器(Program Counter Register)

    基本特性: 当前线程执行的字节码的行号指示器. Java虚拟机支持多个线程同时执行,每一个线程都有自己的pc寄存器. 任意时刻,一个线程都只会执行一个方法的代码,称为该线程的当前方法,对于非nativ ...

  3. EFM32 ARM+ KEIl program

    1Hardware connection When using the EFM32 starter kit to make a JLINK burn, you must connect the con ...

  4. [Chapter 3 Process]Practice 3.2 Including the initial parent process, how many processes are created by the program shown in Figure?

    3.2 Including the initial parent process, how many processes are created by the program shown in Fig ...

  5. Application binary interface and method of interfacing binary application program to digital computer

    An application binary interface includes linkage structures for interfacing a binary application pro ...

  6. [Advance] How to debug a program (上)

    Tool GDB Examining Memory (data or in machine instructions) You can use the command x (for “examine” ...

  7. SQLite学习笔记(十一)&&虚拟机原理

    前言      我们知道任何一种关系型数据库管理系统都支持SQL(Structured Query Language),相对于文件管理系统,用户不用关心数据在数据库内部如何存取,也不需要知道底层的存储 ...

  8. SQLite3源程序分析之虚拟机

    前言 最早的虚拟机可追溯到IBM的VM/370,到上个世纪90年代,在计算机程序设计语言领域又出现一件革命性的事情——Java语言的出现,它与c++最大的不同在于它必须在Java虚拟机上运行.Java ...

  9. SQLite入门与分析(七)---浅谈SQLite的虚拟机

    写在前面:虚拟机技术在现在是一个非常热的技术,它的历史也很悠久.最早的虚拟机可追溯到IBM的VM/370,到上个世纪90年代,在计算机程序设计语言领域又出现一件革命性的事情——Java语言的出现,它与 ...

随机推荐

  1. lightswitch 添加 TreeView 控件

    代码片段 <UserControl xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk&q ...

  2. Python和Java分别实现冒泡排序

    1.基本思想 冒泡排序的基本思想是对比相邻的元素值.相邻元素值比较,如果满足条件两者就交换,把较小的移动到前面,把较大的移动到后面,这样较小的元素就像气泡一样浮上来了.可以看出,冒泡排序的每一次循环都 ...

  3. (转)分享一个技巧,利用批处理调用ruby脚本(可能你为路径苦恼)

    #关闭命令显示 @echo off #提示信息 echo Now,listing the controller,please not shutdown the DOS File! #切换到当前路径,. ...

  4. 数据结构-Python3.7<三>

    上一篇:流程控制-Python<二> 因为列表具有pop.append.insert方法,因此列表可以当作堆.栈使用.由于性能问题,不建议当作堆.(堆:队列优先,先进先出(FIFO—fir ...

  5. Android开发day-01

    http://note.youdao.com/noteshare?id=b7f0d55c1e5eab20bb47e5c58e683611

  6. Ajax实现的城市二级联动二

    上一篇联动一种只是城市用ajax请求获取并渲染,这里将省份也用ajax请求并渲染 1.HTML <select id="province"> <option> ...

  7. 洛谷P3987 我永远喜欢珂朵莉~(set 树状数组)

    题意 题目链接 Sol 不会卡常,自愧不如.下面的代码只有66分.我实在懒得手写平衡树了.. 思路比较直观:拿个set维护每个数出现的位置,再写个线段树维护区间和 #include<bits/s ...

  8. 关于jQuery出现的新添加元素点击事件无效

    //通常点击写法: $(".div").on('click', function () { var $this = $(this); var isActive = $this.ha ...

  9. Git应用—03分支管理和冲突解决(转载)

    Git 分支管理和冲突解决 https://www.cnblogs.com/mengdd/p/3585038.html 创建分支 git branch 没有参数,显示本地版本库中所有的本地分支名称. ...

  10. mysql5.7 安装和多源复制实践

    MySQL 5.7发布后,在复制方面有了很大的改进和提升.比如开始支持多源复制(multi-source)以及真正的支持多线程复制了.多源复制可以使用基于二进制日子的复制或者基于事务的复制.下面我们说 ...