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

Subversion Repositories mips32

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 jjf
#the cache example to calculate the DIV
2
main:
3
lw $a0, 0($zero)
4
lw $a1, 4($zero)
5
jal DIV
6
#to flush the cache to write back the saved data
7
lw $t0, 2048($zero)
8
lw $t1, 2080($zero)
9
nop
10
nop
11
nop
12
j main
13
 
14
###the function of DIV
15
DIV:
16
addi $v0, $zero, 0
17
addi $v1, $zero, 0
18
addi $t0, $a0, 0
19
DIV_START:
20
slt $t1, $t0, $a1
21
bne $t1, $zero, DIV_DONE
22
sub $t0, $t0, $a1
23
addi $v0, $v0, 1
24
j DIV_START
25
DIV_DONE:
26
addi $v1, $t0, 0
27
sw $v0, 32($zero)
28
sw $v1, 36($zero)
29
jr $ra          #return the function

powered by: WebSVN 2.1.0

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