JUMP Instruction Property
The jump (JUMP) instruction tells the computer to jump to an arbitrary instruction number. This is done by updating the Program Counter (PC). More formally:
if the following are true:
- instruction #i is
jump imm=jump_to
- the PC at time t = i
then the PC at time (t + 1) = jump_to
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Initially, the PC is 0, so instruction #0 is executed. In the JUMP instruction, imm is 2, which means that, after the JUMP instruction is executed, the PC should be set to 2. Thus, after the JUMP instruction, instruction #1 is skipped, and instruction #2, an ADDI instruction, is executed next. In other words:
if the following are true:
- instruction #0 is
jump imm=2
- the PC at time 0 = 0
then the PC at time (0 + 1) = 2
Comments
Please log in to add comments