MIPS has 32 x 32-bit registers
0 ~ 31
32-bit data is called a ”word”
Why only 32 registers?
the MIPS convention is to use two-character names following a dollar sign to represent a register:
Assembler names
$t0,$t1,…,$t9 for temporary values$s0,$s1,…,$s7 for saved variablesfor example, if we want to calculate f = (g + h) - (i + j); in c, we don’t need to save intermediate values (g + h), (i + j) . Thus we can write as:
add $t0, $s0, $s1
add $t1, $s2, $s3
sub $s4, $t0, $t1
where $s0, $s1, $s2, $s3 each corresponds to g, h, i, j .
Arithmetic Operation only occur on registers in MIPS instructions. Therefore there needs to be data transfer instructions.