| <<< Reading from data memory | Index | C expression and Assembly example >>> |
Basic instruction to write integer to memory is called store word
sw $t1, 4($t2) # Memory[$t2+4] = $t1
$t2 contains the base address
4 is the offset
Shortcuts:
sw $t1, 0($t2)
sw $t1, $t2 # the same
sw $t1, label # Memory[label] = $t1
sw $t1, label + 4 # Memory[label+4] = $t1
| <<< Reading from data memory | Index | C expression and Assembly example >>> |