A good answer might be:

        . . . .
        # $s1 contains the address of the first struct
        # $s2 contains the address of the second struct
        #      
        # write out the first struct    
        move    $a0,$s1
        jal     PStruct
           
        # write out the second struct    
        move    $a0,$s2
        jal     PStruct

Only One Copy

When you call a subroutine in this manner, you probably think of the struct as being "sent" to the subroutine. In reality, the struct stays where it is and the subroutine just gets its address.

The subroutine now has full access to the struct and can copy values from fields and change values in field. There is only one instance of this struct. If the subroutine changes a field it is a permanent change.

Some high level language use other methods of passing arguments. The style discussed here is similar to ANSI C.

QUESTION 13:

Would looking at and playing with a complete program help?