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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [mp3/] [sw/] [ints/] [ints.S] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 329 lampret
#include "spr_defs.h"
2
 
3 319 lampret
        .extern main
4
        .extern _src_beg
5
        .extern _dst_beg
6
        .extern _dst_end
7
        .extern _c_reset
8
 
9
.org 0x100
10
 
11
_reset:
12
        l.nop
13
        l.nop
14
        l.movhi r0, 0x0
15
        l.slli  r0,r0,16
16
        l.addi  r1,r0,0x0
17
        l.addi  r2,r0,0x0
18
        l.addi  r3,r0,0x0
19
        l.addi  r4,r0,0x0
20
        l.addi  r5,r0,0x0
21
        l.addi  r6,r0,0x0
22
        l.addi  r7,r0,0x0
23
        l.addi  r8,r0,0x0
24
        l.addi  r9,r0,0x1234
25
        l.addi  r10,r0,0x0
26
        l.addi  r11,r0,0x0
27
        l.addi  r12,r0,0x0
28
        l.addi  r13,r0,0x0
29
        l.addi  r14,r0,0x0
30
        l.addi  r15,r0,0x0
31
        l.addi  r16,r0,0x0
32
        l.addi  r17,r0,0x0
33
        l.addi  r18,r0,0x0
34
        l.addi  r19,r0,0x0
35
        l.addi  r20,r0,0x0
36
        l.addi  r21,r0,0x0
37
        l.addi  r22,r0,0x0
38
        l.addi  r23,r0,0x0
39
        l.addi  r24,r0,0x0
40
        l.addi  r25,r0,0x0
41
        l.addi  r26,r0,0x0
42
        l.addi  r27,r0,0x0
43
        l.addi  r28,r0,0x0
44
        l.addi  r29,r0,0x0
45
        l.addi  r30,r0,0x0
46
        l.addi  r31,r0,0x0
47
 
48
        l.movhi r2,hi(_main)
49
        l.ori   r2,r2,lo(_main)
50
        l.jr    r2
51
        l.addi  r2,r0,0
52
 
53 329 lampret
.org 0x0500
54 319 lampret
_lpint:
55
        l.nop
56
        l.nop
57
 
58
# clear TTMR[IP]
59 329 lampret
        l.addi r4,r0,SPR_TTMR
60
        l.movhi r5,hi(SPR_TTMR_RT | SPR_TTMR_IE)
61 319 lampret
        l.addi r5,r5,733
62 329 lampret
        l.mtspr r4,r5,0         # set TTMR
63 319 lampret
 
64
# clear entire PICSR
65 329 lampret
        l.movhi r4,hi(SPR_PICSR)
66
        l.addi r4,r0,lo(SPR_PICSR)
67
        l.addi r5,r0,0x0000
68
        l.mtspr r4,r5,0         # set PICSR
69 319 lampret
 
70
        l.nop
71
        l.rfe
72
        l.nop
73
        l.nop
74
 
75 340 lampret
.org 0x0800
76
_hpint:
77 319 lampret
        l.nop
78
        l.nop
79 340 lampret
 
80
# clear TTMR[IP]
81
        l.addi r4,r0,SPR_TTMR
82
        l.movhi r5,hi(SPR_TTMR_RT | SPR_TTMR_IE)
83
        l.addi r5,r5,733
84
        l.mtspr r4,r5,0         # set TTMR
85 319 lampret
 
86 340 lampret
# clear entire PICSR
87
        l.movhi r4,hi(SPR_PICSR)
88
        l.addi r4,r0,lo(SPR_PICSR)
89
        l.addi r5,r0,0x0000
90
        l.mtspr r4,r5,0         # set PICSR
91
 
92 319 lampret
        l.nop
93
        l.rfe
94
        l.nop
95
        l.nop
96
 
97 340 lampret
 
98 319 lampret
.org 0x2000
99
 
100
_main:
101
        l.nop
102
        l.nop
103
 
104
#
105 329 lampret
# set tick to generate an interrupt every, let say 729 cycles
106 319 lampret
#
107 329 lampret
        l.addi r4,r0,SPR_TTMR
108
        l.movhi r5,hi(SPR_TTMR_RT | SPR_TTMR_IE)
109 319 lampret
        l.addi r5,r5,729
110 329 lampret
        l.mtspr r4,r5,0         # set TTMR
111 319 lampret
 
112
#
113
# unmask all ints
114
#
115 329 lampret
        l.movhi r4,hi(SPR_PICMR)
116
        l.addi r4,r0,lo(SPR_PICMR)
117 319 lampret
        l.movhi r5,0xffff
118
        l.addi r5,r5,0xffff
119
        l.mtspr r4,r5,0         # set PICMR
120
 
121
#
122
# Enable exceptions and interrupts
123
#
124 329 lampret
        l.addi r5,r0,SPR_SR_SUPV|SPR_SR_EXR|SPR_SR_EIR
125
        l.mtspr r0,r5,SPR_SR    # set SR
126 319 lampret
 
127
#
128
# clear sanity counters
129
#
130
        l.addi r11,r0,0
131
        l.addi r12,r0,0
132
        l.addi r13,r0,0
133
        l.addi r14,r0,0
134
        l.addi r15,r0,0
135
_loop:
136
        l.addi r11,r11,1
137
        l.nop
138
        l.addi r12,r12,1
139
        l.addi r13,r13,1
140
        l.j _loop
141
        l.addi r14,r14,1
142
        l.addi r15,r15,1
143
        l.nop
144
        l.nop
145
        l.sys 203
146
        l.nop
147
 
148
 

powered by: WebSVN 2.1.0

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