No. You can build unending loops (infinite loops)
with it.
But additional instructions are needed for
while
loops
and for if-then-else
structures.
A
conditional branch instruction
branches to a new address only if a
certain condition is true.
Usually the condition
is about the values in two registers.
Here is the
beq
(branch on equal) instruction:
beq u,v,addr # if register $u == register $v # PC <— addr (after a delay of one machine cycle.) # else # no effect.
The bit patterns in two registers are compared. If the bit patterns are the same, the PC is changed to the branch address. There is a branch delay slot that follows this instruction (just as for a jump instruction).
Will a 32-bit address fit inside the 32-bit
beq
instruction?