$s1
Here is more of the program:
## linked.asm --- hard-coded linked list
##
.text
.globl main
main:
la $s0,elmnt01 # get a pointer to the first element
loop: beqz $s0,done # while the pointer is not null
lw $a0,0($s0) # get the data of this element
. . . # do something with the element
lw $s0,4($s0) # get the pointer to the next element
b loop
done:
.data
elmnt01: .word 1 # displacement 0 off the pointer
.word elmnt02 # displacement 4 off the pointer
. . .
The program starts with the first element. Then (after doing something with the first element) it moves on to the second element by loading the address contained in the link field of the element.
In this case, you want to load data from an
address into a register.
So the lw
instruction
is the correct one to use.