go to previous page   go to home page   go to next page hear noise highlighting

Answer:

A no-op instruction is an instruction that has no effect. A common no-op instruction is sll $0,$0,0.


Altering the PC

Machine Cycle

Here is a sequence of instructions. The "load" and "add" represent typical instructions. The "jump" instruction shows the address we wish to put into the PC. (The actual MIPS instruction for this involves details that we are skipping for the moment.)

main: load ...           
      add  ...
      jump 0x00400000
      no-op

Say the the program has been assembled and loaded at address 0x00400000. The program starts running with the PC holding that address.

Once started, the four instructions execute in an unending loop. The last instruction, a no-op, is in the branch delay slot.

A loop structure is created with the jump instruction. The intent of the jump instruction is to put the address 0x00400000 into the PC. However, it takes one more machine cycle for this to happen.

But once the PC has changed, the next instruction fetched is at the top of the loop. The instructions execute again, and at the end the PC is again set to the starting address.


QUESTION 3:

(Thought question:) Is there anything in this program that will stop the loop from executing?


go to previous page   go to home page   go to next page