There is an instruction in MIPS which allows us to load a number from Memory. like this:
.data
array: .word 1,2,3,4
.text
la $t0, A
lw $t1, 8($t0) #will load 3 to $t1
Is there any way to use (the number inside a register) instead of (immediate number)? like:
li $t2, 8
lw $t1, $t2($t1) # again will load 3 to $t1
If not how can I do indexed addressing with two registers?