OpenCores
URL https://opencores.org/ocsvn/mips32/mips32/trunk

Subversion Repositories mips32

[/] [mips32/] [trunk/] [Classic-MIPS/] [TestBenchs/] [function/] [code4.smd] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jjf
main:
2
addi $sp, $zero, 128
3
addi $a0, $zero, 43
4
addi $a1, $zero, -89
5
addi $a2, $zero, 893
6
addi $s0, $zero, -111
7
sw $a0, 0($zero)
8
sw $a1, 4($zero)
9
sw $a2, 8($zero)
10
sw $s0, 12($zero)
11
jal ADD4
12
j DONE
13
 
14
ADD2:
15
#save the context
16
sw $ra, 0($sp)
17
addi $sp, $sp, 4
18
#calculate
19
add $v0, $a0, $a1
20
sw $v0, 16($zero)
21
#get the return address
22
addi $sp, $sp, -4
23
lw $ra, 0($sp)
24
jr $ra
25
 
26
 
27
ADD3:
28
#save the context
29
sw $ra, 0($sp)
30
addi $sp, $sp, 4
31
#calculate $a0 + $a1
32
jal ADD2
33
ori $a0, $v0, 0
34
ori $a1, $a2, 0
35
jal ADD2
36
#get the return address
37
addi $sp, $sp, -4
38
lw $ra, 0($sp)
39
jr $ra
40
 
41
ADD4:
42
sw $ra, 0($sp)
43
addi $sp, $sp, 4
44
jal ADD3
45
ori $a0, $v0, 0
46
ori $a1, $s0, 0
47
jal ADD2
48
addi $sp, $sp, -4
49
lw $ra, 0($sp)
50
jr $ra
51
 
52
DONE:
53
sw $v0, 16($zero)
54
lw $t0, 2048($zero)
55
lw $t1, 2080($zero)
56
nop
57
nop
58
nop
59
 
60
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.