A3_1 - ori $24, $0, 1 # first number # loop: l add $12, $8,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
## A3_1.asm ## Written by: Colin Swelin 0308676 ## Program to compute 12 Fibonacci numbers ## ## Registers: ## $8 --- current ## $9 --- previous ## $10 --- total iterations ## $11 --- current interation total ## $12 --- new current ## $24 --- Final fibonacci total # .text .globl main . main: m ori $9, $0, 1 # $9 <-- 1 ori $10, $0, 11 # max interations-1
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ori $24, $0, 1 # first number # loop: l add $12, $8, $9 # next fibonacci number add $24, $24, $8 # running total or $8, $0, $9 or $9, $0, $12 # set current number to previous # addu $11, $11, 1 # increase interation count # bne $10, $11, loop # branch if not equal sll $0, $0, $0 # branch delay # ## end of file...
View Full Document

Ask a homework question - tutors are online