# # silly 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) # meaningless instruction to make example more interesting(?) add $t0, $t0, $zero # call procedure jal computeX # meaningless instruction to make example more interesting(?) add $t0, $t0, $zero # call procedure jal computeY # meaningless instruction to make example more interesting(?) add $t0, $t0, $zero # closing linkage lw $ra, 0($sp) addi $sp, $sp, 4 jr $ra .end main .data .globl inputX .globl inputY .asciiz "hello!\n" inputX: .word 100 inputY: .word 200