OSDN Git Service

(none)
[hos/hos-v4a.git] / aplfw / sample / arm / ez_arm7 / armcc / startup.s
1
2                                 EXPORT  Reset_Handler
3                                 EXPORT  Undefined_Handler
4                                 EXPORT  Swi_Handler
5                                 EXPORT  Prefetch_Handler
6                                 EXPORT  Abort_Handler
7                                 IMPORT  _kernel_int_isp
8
9
10
11 ; %jp{プロセッサモード定義}
12 Mode_USR                EQU     0x10            ; USR モード
13 Mode_FIQ                EQU             0x11            ; FIQ モード
14 Mode_IRQ                EQU     0x12            ; IRQ モード
15 Mode_SVC                EQU             0x13            ; SVC モード
16 Mode_ABT                EQU             0x17            ; ABT モード
17 Mode_UND                EQU             0x1b            ; UND モード
18 Mode_SYS                EQU     0x1f            ; SYS モード
19 Mode_MASK               EQU     0x1f            ; モードビットマスク
20
21 ; %jp{フラグ定義}
22 T_Bit                   EQU             0x20            ; T ビット
23 F_Bit                   EQU     0x40            ; F ビット
24 I_Bit                   EQU     0x80            ; I ビット
25
26
27
28                                 CODE32
29
30                                 PRESERVE8
31                                 AREA    Init, CODE, READONLY
32
33
34 ; リセットハンドラ
35 Reset_Handler
36                 ; --- SYSモード移行
37                                 msr             cpsr_c, #Mode_SYS:OR:F_Bit:OR:I_Bit
38
39                 ; --- スタック仮設定
40                                 ldr             r0, =_kernel_int_isp
41                                 ldr     sp, [r0]
42                                 
43                 ; --- C言語コードにジャンプ
44                                 IMPORT  __main
45                                 bl              __main
46 end_loop
47                                 b               end_loop
48
49
50
51
52 ;  SWIハンドラ
53 Swi_Handler
54                                 movs    pc, lr
55
56
57 ;  Undefined ハンドラ
58 Undefined_Handler
59                                 b               Undefined_Handler
60
61
62 ;  Prefetch ハンドラ
63 Prefetch_Handler
64                                 b               Prefetch_Handler
65
66
67 ;  Abort ハンドラ
68 Abort_Handler
69                                 b               Abort_Handler
70
71
72
73                                 END
74
75
76 ; end of file