<<< Reserving space | Index | Writing to data memory >>> |
Basic instruction to read integer from memory is called load word
lw $t1, 4($t2) # $t1 = Memory[$t2+4]
Here, $t2 contains the base address, and 4 is the offset
Note that there is a shortcut:
lw $t1, 0($t2) lw $t1, $t2 # the same lw $t1, label # $t1 = Memory[label] lw $t1, label + 4 # $t1 = Memory[label+4]
<<< Reserving space | Index | Writing to data memory >>> |