# # silly example for linking # # main file defines two input variables # file with procedures defines two output variables # .text .globl main main: # opening linkage 0000 addi $sp, $sp, -4 0004 sw $ra, 0($sp) # meaningless instruction to make example more interesting(?) 0008 add $t0, $t0, $zero # call procedure 000c jal computeX # meaningless instruction to make example more interesting(?) 0010 add $t0, $t0, $zero # call procedure 0014 jal computeY # meaningless instruction to make example more interesting(?) 0018 add $t0, $t0, $zero # closing linkage 001c lw $ra, 0($sp) 0020 addi $sp, $sp, 4 0024 jr $ra 0028 (size, hex) .end main .data .globl inputX .globl inputY 0000 .asciiz "hello!\n" (7 chars) 0007 inputX: 0008 .word 100 ("word" forces alignment) inputY: 000c .word 200 0010 (size, hex)