.file "fibo.c" .text .align 2 .globl fibo .type fibo, @function fibo: add sp,sp,-32 sw ra,28(sp) sw s0,24(sp) sw s1,20(sp) add s0,sp,32 sw a0,-20(s0) lw a4,-20(s0) li a5,1 bgtu a4,a5,.L2 lw a5,-20(s0) j .L3 .L2: lw a5,-20(s0) add a5,a5,-1 move a0,a5 call fibo move s1,a0 lw a5,-20(s0) add a5,a5,-2 move a0,a5 call fibo move a5,a0 add a5,s1,a5 .L3: move a0,a5 lw ra,28(sp) lw s0,24(sp) lw s1,20(sp) add sp,sp,32 jr ra .size fibo, .-fibo .section .rodata .align 2 .LC0: .string "hello, world!\r" .align 2 .LC1: .string "fibo(%02d) = " .align 2 .LC2: .string "%06d (%05ums) (%u ticks)\n" .text .align 2 .globl main .type main, @function main: add sp,sp,-64 sw ra,60(sp) sw s0,56(sp) add s0,sp,64 sw a0,-52(s0) sw a1,-56(s0) lui a5,%hi(.LC0) add a0,a5,%lo(.LC0) call puts sw zero,-20(s0) j .L5 .L6: lui a5,%hi(.LC1) add a0,a5,%lo(.LC1) lw a1,-20(s0) call printf lw a5,-20(s0) move a0,a5 call fibo move a5,a0 sw a5,-24(s0) lw a4,-28(s0) lw a5,-32(s0) sub a5,a4,a5 sw a5,-36(s0) lui a5,%hi(.LC2) add a0,a5,%lo(.LC2) lw a1,-24(s0) lw a2,-40(s0) lw a3,-36(s0) call printf lw a5,-20(s0) add a5,a5,1 sw a5,-20(s0) .L5: lw a4,-20(s0) li a5,26 ble a4,a5,.L6 .L7: j .L7 .size main, .-main .ident "GCC: (GNU) 4.9.2"