I'm writing a program that takes input for an an array. It then uses a loop to replace the values in another array that has preset values with the values from the array that received input.
When I try to move the values though...well let's say arrayA is the one with the preset values and arrayB is the one that has the inputted values. lw $t3, arrayB($t0) - yields an error, but lw $t3, arrayA($0) works. Is there another command that needs to be used when getting the value from an array that doesn't have preset content?
.data
strOutput: .asciiz "Input: "
arrayA: .word 1,2,3,4
arrayB: .space 16
.text
.globl main
main:
li $v0, 4
la $a0, strOutput
syscall
la $t1,arrayB
li $v0, 8
la $a0, 0($t1)
syscall
li $v0, 8
la $a0, 4($t1)
syscall
li $v0, 8
la $a0, 8($t1)
syscall
li $v0, 8
la $a0, 12($t1)
syscall
li $t0, 0
lw $t3, arrayB($t0)
I know it's very basic, but I don't know if I'm missing a command or something. Using PCSpim.
And also the number replacement will be done with a loop hence why I'm using arrayB($t0) instead of something else...if that makes any sense at all.