-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathfibonacci.txt
55 lines (45 loc) · 1.31 KB
/
fibonacci.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
int fibonnaci(int n){
int a = 0;
int b = 1;
int k;
for(int i = 0; i < n; i++){
k = a + b;
a = b;
b = k;
}
return k;
}
li $3, 5
addi $7, $0, 0 # a
addi $8, $0, 1 # b
addi $9, $0, 0 # i
loop: slt $10, $9, $3
beq $10, $0, Exit
add $1, $7, $8
add $7, $8, $0
add $8, $1, $0
addi $9, $9, 1
j loop
Exit:
100011 00000 00011 0000000000000000
001000 00000 00111 0000000000000000
001000 00000 01000 0000000000000001
001000 00000 01001 0000000000000000
000000 01001 00011 01010 00000 101010
000100 01010 00000 0000000000000101
000000 00111 01000 00001 00000 100000
000000 01000 00000 00111 00000 100000
000000 00001 00000 01000 00000 100000
001000 01001 01001 0000000000000001
000010 00000000000000000000000100
0 10001100 00000011 00000000 00000000 8c030000
4 00100000 00000111 00000000 00000000 20070000
8 00100000 00001000 00000000 00000001 20080001
C 00100000 00001001 00000000 00000000 20090000
10 00000001 00100011 01010000 00101010 0123502a
14 00010001 01000000 00000000 00000101 11400005
18 00000000 11101000 00001000 00100000 00e80820
1C 00000001 00000000 00111000 00100000 01003820
20 00000000 00100000 01000000 00100000 00204020
24 00100001 00101001 00000000 00000001 21290001
28 00001000 00000000 00000000 00000100 08000004