Program counter

  • PC is a 16-bit register. It contains a memory address. PC contains that very memory address from where the next instruction is to be fetched for execution.
  • Suppose the PC contents are 8000H, then it means that the 8085 Desires to fetch the instruction Byte at 8000H.
  • After fetching the Byte at 8000H, the PC is automatically incremented by 1.
  • This way 8085 becomes ready to fetch the next Byte of the instruction (in case instruction fetch is incomplete), or fetch the next opcode (in case instruction fetch is over).
  • So in this example, first of all PC is loaded with the value 8000H. This is done by typing the ‘Go’ key, then typing “8000”, and finally typing the “Exec” key. Then the 8085 performs the following action.
  • It sends out 8000H the address, which is the content of the PC. From location 8000H it receives 21H, the opcode for LXI H.
  • It is received in an 8-bit register called instruction register (IR for short), as shown in the following figure.
Posted on by