A null (zero) is placed in the link field of the last node. (Actually, for SPIM, a zero is already there. But with a real OS where dynamic memory is both allocated and deallocated you must be sure to zero the link.)
done: # end the list sw $0,4($s1) # put null in the link field # of the current node, which # is the last node.
Now
the linked list has been constructed.
The field first
points to the first node.
Here is some code from the previous chapter.
The code traverses a linked list, printing out
the data found at each node.
Our new linked list has the same form as the previous chapter's linked list. This code will work fine.
But, those blanks... Fill them in.