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

Subversion Repositories eco32

[/] [eco32/] [trunk/] [fpga/] [tests/] [test_054/] [copy/] [copy.s] - Blame information for rev 297

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 295 hellwig
;
2
; copy.s -- copy a program from ROM to RAM before executing it
3
;
4
 
5
        .set    dst,0xC0000000          ; destination is start of RAM
6
        .import size                    ; number of bytes to be copied
7
 
8
        .set    PSW,0                    ; reg # of PSW
9
 
10
        .nosyn
11
 
12
reset:
13
        j       start
14
 
15
interrupt:
16
        j       interrupt               ; we better have no interrupts
17
 
18
userMiss:
19
        j       userMiss                ; and no user TLB misses
20
 
21
start:
22
        mvts    $0,PSW                   ; disable interrupts and user mode
23
 
24
        add     $0,$0,$0
25
        add     $0,$0,$0
26
        add     $0,$0,$0
27
        add     $0,$0,$0
28
        add     $0,$0,$0
29
        add     $0,$0,$0
30
 
31
        ldhi    $8,src
32
 
33
        add     $0,$0,$0
34
        add     $0,$0,$0
35
        add     $0,$0,$0
36
        add     $0,$0,$0
37
        add     $0,$0,$0
38
        add     $0,$0,$0
39
 
40
        or      $8,$8,src
41
 
42
        add     $0,$0,$0
43
        add     $0,$0,$0
44
        add     $0,$0,$0
45
        add     $0,$0,$0
46
        add     $0,$0,$0
47
        add     $0,$0,$0
48
 
49
        ldhi    $9,dst
50
 
51
        add     $0,$0,$0
52
        add     $0,$0,$0
53
        add     $0,$0,$0
54
        add     $0,$0,$0
55
        add     $0,$0,$0
56
        add     $0,$0,$0
57
 
58
        add     $10,$9,size
59
 
60
        add     $0,$0,$0
61
        add     $0,$0,$0
62
        add     $0,$0,$0
63
        add     $0,$0,$0
64
        add     $0,$0,$0
65
        add     $0,$0,$0
66
 
67
loop:
68
        ldw     $11,$8,0         ; copy word
69
 
70
        add     $0,$0,$0
71
        add     $0,$0,$0
72
        add     $0,$0,$0
73
        add     $0,$0,$0
74
        add     $0,$0,$0
75
        add     $0,$0,$0
76
 
77
        stw     $11,$9,0
78
 
79
        add     $0,$0,$0
80
        add     $0,$0,$0
81
        add     $0,$0,$0
82
        add     $0,$0,$0
83
        add     $0,$0,$0
84
        add     $0,$0,$0
85
 
86
        add     $8,$8,4                 ; bump pointers
87
 
88
        add     $0,$0,$0
89
        add     $0,$0,$0
90
        add     $0,$0,$0
91
        add     $0,$0,$0
92
        add     $0,$0,$0
93
        add     $0,$0,$0
94
 
95
        add     $9,$9,4
96
 
97
        add     $0,$0,$0
98
        add     $0,$0,$0
99
        add     $0,$0,$0
100
        add     $0,$0,$0
101
        add     $0,$0,$0
102
        add     $0,$0,$0
103
 
104
        bltu    $9,$10,loop             ; more?
105
 
106
        add     $0,$0,$0
107
        add     $0,$0,$0
108
        add     $0,$0,$0
109
        add     $0,$0,$0
110
        add     $0,$0,$0
111
        add     $0,$0,$0
112
 
113
        ldhi    $8,dst                  ; start execution
114
 
115
        add     $0,$0,$0
116
        add     $0,$0,$0
117
        add     $0,$0,$0
118
        add     $0,$0,$0
119
        add     $0,$0,$0
120
        add     $0,$0,$0
121
 
122
        jr      $8
123
 
124
        add     $0,$0,$0
125
        add     $0,$0,$0
126
        add     $0,$0,$0
127
        add     $0,$0,$0
128
        add     $0,$0,$0
129
        add     $0,$0,$0
130
 
131
        ; the program to be copied follows immediately
132
src:

powered by: WebSVN 2.1.0

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