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

Answer:

Five. Each time the loop executes, the instruction in the branch delay slot increments $8.


Assembled Program

Here is a SPIM view of the program. When you run it, remember to set the value of the PC to 0x400000. To see the branch delay it should be enabled in the options menu.

The assembler constructed the same machine language jump instruction as we did by hand. (Compare with two pages back). Using the assembler and a symbolic address is much easier.

SPIM Program

QUESTION 9:

Is the jump instruction all we need to construct a while loop?


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