Program Counter - 2024.2 English

MicroBlaze Processor Reference Guide (UG984)

Document ID
UG984
Release Date
2024-11-27
Version
2024.2 English

The program counter (PC) is the address of the execution instruction. It can be read with an MFS instruction, but it cannot be written with an MTS instruction. When used with the MFS instruction the PC register is specified by setting Sa = 0x0000. The following figure illustrates the PC and the following table provides a description and reset value.

When 64-bit MicroBlaze is enabled (C_DATA_SIZE = 64), the Program Counter has up to 64 bits, according to the C_ADDR_SIZE parameter, otherwise it has 32 bits.

Figure 1. PC
Table 1. Program Counter (PC)
Bits 1 Name Description Reset Value

0:31

0:C_ADDR_SIZE-1

PC

Program Counter

Address of executing instruction, that is, “mfs r2 0” stores the address of the mfs instruction itself in R2.

C_BASE_VECTORS
  1. C_ADDR_SIZE bits with 64-bit MicroBlaze (C_DATA_SIZE = 64) and 32 bits otherwise.