计组_程序计数器(PC/IAR/IP/program counter/instruction pointer/instruction address register)

文章目录

Contents

synopsis

  • 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.[nb 1]
  • Usually, the PC is incremented after fetching an instruction, and holds the memory address of (“points to”) the next instruction that would be executed.[4][nb 2]
  • 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.
posted @ 2022-03-14 15:14  xuchaoxin1375  阅读(27)  评论(0)    收藏  举报  来源