Header Ads Widget

Responsive Advertisement

Ticker

6/recent/ticker-posts

program counter

Almost every digital computer ever made uses a program counter. The program counter points to the memory location that stores the next executable instruction. Branching is implemented by making changes to the program counter. Some processor designs allow software to directly change the program counter, but usually software only indirectly changes the program counter (for example, a JUMP instruction will insert the operand into the program counter). An assembler has a location counter, which is an internal pointer to the address (first byte) of the next location in storage (for instructions, data areas, constants, etc.) while the source code is being converted into object code.

The VAX uses the 16th of 16 general purpose registers as the program counter (PC). Almost the entire instruction set can directly manipulate the program counter, allowing a very rich set of possible kinds of branching.

The program counter in System/360 and 370 machines is contained in bits 40-63 of the program status word (PSW), which is directly accessible by some instructions.

  • IBM 360/370: program counter is bits 40-63 of the program status word (PSW)
  • Intel 8086/80286: 16-bit instruction pointer (IP)
  • Intel 80386: 32-bit instruction pointer (EIP)
  • Motorola 680x0, 68300: 32-bit program counter (PC)

Post a Comment

0 Comments