# # example for linking # # main file defines two input variables # file with procedures defines two output variables # .text .globl main main: # opening linkage addi $sp, $sp, -4 sw $ra, 0($sp) # call two procedures in other file add $t0, $t0, $zero jal computeX add $t0, $t0, $zero jal computeY add $t0, $t0, $zero # call local procedure jal plocal # closing linkage lw $ra, 0($sp) addi $sp, $sp, 4 jr $ra # local procedure plocal: jr $ra .data .globl inputX .globl inputY .asciiz "hello!\n" inputX: .word 100 inputY: .word 200