T.I.M | ISA Specification
 All Pages
Program Counter

Address: 0000, Memonic: PC

Functionality:

Stores the address of the next instruction to be fetched from memory into the execution pipeline. Because of the variable instruction lengths, addresses need not be 4-byte aligned. Each time an instruction is fetched, its length in bytes is added to the PC

The initial value of the program counter after reset is zero.

This register is 32 bits wide.

Access

The PC can only be read directly by the MOVSR instruction, which coppies its value into a general purpose register. Other instructions such as JUMPI, JUMPR and CALLI / CALLR implicitly modify it's value as well as performing other operations on other registers. The PUSH and POP instructions can also directly access the PC for calling and returning from functions.

Can be read by:

  • MOVSR
  • PUSH
  • TEST

Can be written by:

  • JUMPI
  • JUMPR
  • CALLR
  • CALLI
  • POP
  • RETURN