JUMPR Instruction Property

The jump-register (JUMPR) instruction tells the computer to jump to an arbitrary instruction number specified in a memory cell. This is done by updating the Program Counter (PC) to a value stored in a cell. More formally:

if the following are true:
  • instruction #i is jumpr addr=addr
  • the PC at time t = i

then the PC at time (t + 1) = value of cell addr at time t

Here is an example where instruction #0 is a JUMPR instruction:
Instructions
Memory Cells
Program Counter Time
0 0
LW Computer Simulator

Initially, the PC is 0, so instruction #0 is executed. In the JUMPR instruction, addr is 1, so when the JUMP instruction is executed, the PC should be set to the value stored in memory cell #1, which is 3. Thus, after the JUMP instruction, instructions #1 and #2 are skipped, and instruction #3 is executed next. In other words:

if the following are true:

  • instruction #0 is jumpr addr=1
  • the PC at time 0 = 0

then the PC at time (0 + 1) = value of cell 1 at time 0


Comments

Please log in to add comments