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

Answer:

No, because register $0 always contains a zero. You may try to copy a value into it, and the instruction will appear to execute correctly, but register zero will not be changed.


Model Machine Cycle

machine cycle

The MIPS assembly programming model includes a machine cycle (repeated here from chapter one). The MIPS endlessly cycles through three basic steps. Each cycle executes one machine instruction. Everything the processor does is done by a sequence of machine operations. So, everything that a program does is the result of performing millions of machine cycles.

As execution proceeds through a list of instructions, a special register, the program counter, points at the instruction that is next in line to execute.

Fetch the next Instruction. The program counter contains the address of the next machine instruction. The instruction is fetched from memory.
Increment the PC. The address in the program counter is incremented by four.
Execute the Instruction. The machine operation specified by the instruction is performed.

QUESTION 8:

Why is the program counter (PC) incremented by four each time?