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

Subversion Repositories Aquarius

[/] [Aquarius/] [trunk/] [application/] [shc_clock/] [startup/] [crt0.S] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 thorn_aitc
/****************************************
2
 SuperH (SH-2) C compiler Startup Routine
3
 ----------------------------------------
4
     Rev1. March 21, 2003 by Thorn Aitch
5
 ****************************************/
6
 
7
/********************
8
 Section: .text (ROM)
9
 ********************/
10
    .section  .text
11
 
12
/************
13
 Vector Table
14
 ************/
15
_vector_top:
16
    .long     _start       ! #000
17
    .long     _stack+0x200 ! #001
18
    .long     _start       ! #002
19
    .long     _stack+0x200 ! #003
20
    .long     _gnrl_ilgl   ! #004
21
    .long     _unexpected  ! #005
22
    .long     _slot_ilgl   ! #006
23
    .long     _unexpected  ! #007
24
    .long     _unexpected  ! #008
25
    .long     _cpuerr      ! #009
26
    .long     _dmaerr      ! #010
27
    .long     _nmi         ! #011
28
    .long     _unexpected  ! #012
29
    .long     _unexpected  ! #013
30
    .long     _unexpected  ! #014
31
    .long     _unexpected  ! #015
32
    .long     _unexpected  ! #016
33
    .long     _unexpected  ! #017
34
    .long     _unexpected  ! #018
35
    .long     _unexpected  ! #019
36
    .long     _unexpected  ! #020
37
    .long     _unexpected  ! #021
38
    .long     _unexpected  ! #022
39
    .long     _unexpected  ! #023
40
    .long     _unexpected  ! #024
41
    .long     _unexpected  ! #025
42
    .long     _unexpected  ! #026
43
    .long     _unexpected  ! #027
44
    .long     _unexpected  ! #028
45
    .long     _unexpected  ! #029
46
    .long     _unexpected  ! #030
47
    .long     _unexpected  ! #031
48
    .long     _trap        ! #032
49
    .long     _trap        ! #033
50
    .long     _trap        ! #034
51
    .long     _trap        ! #035
52
    .long     _trap        ! #036
53
    .long     _trap        ! #037
54
    .long     _trap        ! #038
55
    .long     _trap        ! #039
56
    .long     _trap        ! #040
57
    .long     _trap        ! #041
58
    .long     _trap        ! #042
59
    .long     _trap        ! #043
60
    .long     _trap        ! #044
61
    .long     _trap        ! #045
62
    .long     _trap        ! #046
63
    .long     _trap        ! #047
64
    .long     _trap        ! #048
65
    .long     _trap        ! #049
66
    .long     _trap        ! #050
67
    .long     _trap        ! #051
68
    .long     _trap        ! #052
69
    .long     _trap        ! #053
70
    .long     _trap        ! #054
71
    .long     _trap        ! #055
72
    .long     _trap        ! #056
73
    .long     _trap        ! #057
74
    .long     _trap        ! #058
75
    .long     _trap        ! #059
76
    .long     _trap        ! #060
77
    .long     _trap        ! #061
78
    .long     _trap        ! #062
79
    .long     _trap        ! #063
80
    .long     _irq0        ! #064
81
    .long     _irq1        ! #065
82
    .long     _irq2        ! #066
83
    .long     _irq3        ! #067
84
    .long     _irq4        ! #068
85
    .long     _irq5        ! #069
86
    .long     _irq6        ! #070
87
    .long     _irq7        ! #071
88
 
89
/***************
90
 General Illegal
91
 Slot Illegal
92
 ***************/
93
_gnrl_ilgl:
94
_slot_ilgl:
95
    mov.l    _pillegal, r0
96
    jsr      @r0
97
    nop
98
_restart:
99
    mov.l    _pvector_top, r1
100
    mov.l    @r1, r0
101
    jmp      @r0
102
    mov.l    @(4, r1), r15
103
 
104
/*****************
105
 CPU Address Error
106
 DMA Address Error
107
 Unexpected Vector
108
 *****************/
109
_cpuerr:
110
_dmaerr:
111
_unexpected:
112
    mov.l    _perror, r0
113
    jsr      @r0
114
    nop
115
    bra      _restart
116
    nop
117
 
118
/****************************
119
 NMI (Non Maskable Interrupt)
120
 ****************************/
121
_nmi:
122
    stc.l   gbr, @-r15
123
    stc.l   vbr, @-r15
124
    sts.l   mach, @-r15
125
    sts.l   macl, @-r15
126
    sts.l   pr, @-r15
127
    mov.l   r14, @-r15
128
    mov.l   r13, @-r15
129
    mov.l   r12, @-r15
130
    mov.l   r11, @-r15
131
    mov.l   r10, @-r15
132
    mov.l   r9, @-r15
133
    mov.l   r8, @-r15
134
    mov.l   r7, @-r15
135
    mov.l   r6, @-r15
136
    mov.l   r5, @-r15
137
    mov.l   r4, @-r15
138
    mov.l   r3, @-r15
139
    mov.l   r2, @-r15
140
    mov.l   r1, @-r15
141
    mov.l   r0, @-r15
142
    mov.l    _pnmi_handler, r0
143
    jsr      @r0
144
    nop
145
    mov.l   @r15+, r0
146
    mov.l   @r15+, r1
147
    mov.l   @r15+, r2
148
    mov.l   @r15+, r3
149
    mov.l   @r15+, r4
150
    mov.l   @r15+, r5
151
    mov.l   @r15+, r6
152
    mov.l   @r15+, r7
153
    mov.l   @r15+, r8
154
    mov.l   @r15+, r9
155
    mov.l   @r15+, r10
156
    mov.l   @r15+, r11
157
    mov.l   @r15+, r12
158
    mov.l   @r15+, r13
159
    mov.l   @r15+, r14
160
    lds.l   @r15+, pr
161
    lds.l   @r15+, macl
162
    lds.l   @r15+, mach
163
    ldc.l   @r15+, vbr
164
    ldc.l   @r15+, gbr
165
    rte
166
    nop
167
 
168
/***********************
169
 IRQ (Interrupt Request)
170
 ***********************/
171
_irq0:
172
_irq1:
173
_irq2:
174
_irq3:
175
_irq4:
176
_irq5:
177
_irq6:
178
_irq7:
179
    stc.l   gbr, @-r15
180
    stc.l   vbr, @-r15
181
    sts.l   mach, @-r15
182
    sts.l   macl, @-r15
183
    sts.l   pr, @-r15
184
    mov.l   r14, @-r15
185
    mov.l   r13, @-r15
186
    mov.l   r12, @-r15
187
    mov.l   r11, @-r15
188
    mov.l   r10, @-r15
189
    mov.l   r9, @-r15
190
    mov.l   r8, @-r15
191
    mov.l   r7, @-r15
192
    mov.l   r6, @-r15
193
    mov.l   r5, @-r15
194
    mov.l   r4, @-r15
195
    mov.l   r3, @-r15
196
    mov.l   r2, @-r15
197
    mov.l   r1, @-r15
198
    mov.l   r0, @-r15
199
    mov.l    _pirq_handler, r0
200
    jsr      @r0
201
    nop
202
    mov.l   @r15+, r0
203
    mov.l   @r15+, r1
204
    mov.l   @r15+, r2
205
    mov.l   @r15+, r3
206
    mov.l   @r15+, r4
207
    mov.l   @r15+, r5
208
    mov.l   @r15+, r6
209
    mov.l   @r15+, r7
210
    mov.l   @r15+, r8
211
    mov.l   @r15+, r9
212
    mov.l   @r15+, r10
213
    mov.l   @r15+, r11
214
    mov.l   @r15+, r12
215
    mov.l   @r15+, r13
216
    mov.l   @r15+, r14
217
    lds.l   @r15+, pr
218
    lds.l   @r15+, macl
219
    lds.l   @r15+, mach
220
    ldc.l   @r15+, vbr
221
    ldc.l   @r15+, gbr
222
    rte
223
    nop
224
 
225
/************
226
 TRAP Handler
227
 ************/
228
_trap:
229
    stc.l   gbr, @-r15
230
    stc.l   vbr, @-r15
231
    sts.l   mach, @-r15
232
    sts.l   macl, @-r15
233
    sts.l   pr, @-r15
234
    mov.l   r14, @-r15
235
    mov.l   r13, @-r15
236
    mov.l   r12, @-r15
237
    mov.l   r11, @-r15
238
    mov.l   r10, @-r15
239
    mov.l   r9, @-r15
240
    mov.l   r8, @-r15
241
    mov.l   r7, @-r15
242
    mov.l   r6, @-r15
243
    mov.l   r5, @-r15
244
    mov.l   r4, @-r15
245
    mov.l   r3, @-r15
246
    mov.l   r2, @-r15
247
    mov.l   r1, @-r15
248
    mov.l   r0, @-r15
249
    mov.l    _ptrap_handler, r0
250
    jsr      @r0
251
    nop
252
    mov.l   @r15+, r0
253
    mov.l   @r15+, r1
254
    mov.l   @r15+, r2
255
    mov.l   @r15+, r3
256
    mov.l   @r15+, r4
257
    mov.l   @r15+, r5
258
    mov.l   @r15+, r6
259
    mov.l   @r15+, r7
260
    mov.l   @r15+, r8
261
    mov.l   @r15+, r9
262
    mov.l   @r15+, r10
263
    mov.l   @r15+, r11
264
    mov.l   @r15+, r12
265
    mov.l   @r15+, r13
266
    mov.l   @r15+, r14
267
    lds.l   @r15+, pr
268
    lds.l   @r15+, macl
269
    lds.l   @r15+, mach
270
    ldc.l   @r15+, vbr
271
    ldc.l   @r15+, gbr
272
    rte
273
    nop
274
 
275
/************
276
 Main Routine
277
 ************/
278
    .org     _vector_top + 0x400
279
_start:
280
    mov.l    _pvector_top, r8
281
    ldc      r8, vbr
282
    mov      #0x00, r8
283
    ldc      r8, sr
284
    mov.l    _pmain_sh, r8
285
    jsr      @r8
286
    mov      #0, r14
287
 
288
_endless:
289
    bra      _endless
290
    nop
291
 
292
    .align   4
293
_pmain_sh :     .long _main_sh
294
_pvector_top:   .long _vector_top
295
_pillegal:      .long _illegal
296
_perror:        .long _error
297
_pnmi_handler:  .long _nmi_handler
298
_pirq_handler:  .long _irq_handler
299
_ptrap_handler: .long _trap_handler
300
 
301
/**********************
302
 Section: .rodata (ROM)
303
 **********************/
304
    .section .rodata
305
    .align 4
306
 
307
/********************
308
 Section: .data (RAM)
309
 ********************/
310
    .section .data
311
    .align 4
312
 
313
/*******************
314
 Section: .bss (RAM)
315
 *******************/
316
    .section .bss
317
    .align 4
318
 
319
/*********************
320
 Section: .stack (RAM)
321
 *********************/
322
    .section .stack
323
    .align   4
324
_stack:
325
        .end
326
 

powered by: WebSVN 2.1.0

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