The element is the last one in the list.
The idea is to keep "advancing" the pointer $s0
from
element to element until it contains a null
.
This is done in a loop.
The null pointer is detected with
a beqz
instruction.
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:
Here is a picture that shows the pointer advancing through the elements until it becomes null: