Last change
on this file since 616 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
1.8 KB
|
Line | |
---|
1 | ##============================================================================== |
---|
2 | ## |
---|
3 | ## crt0-eval.S |
---|
4 | ## |
---|
5 | ## MN10300 Series Evaluation Board C startup code |
---|
6 | ## |
---|
7 | ##============================================================================== |
---|
8 | ######COPYRIGHTBEGIN#### |
---|
9 | ## |
---|
10 | ## Copyright (c) 1995, 1996, 1997, 1998 Cygnus Solutions |
---|
11 | ## |
---|
12 | ## The authors hereby grant permission to use, copy, modify, distribute, |
---|
13 | ## and license this software and its documentation for any purpose, provided |
---|
14 | ## that existing copyright notices are retained in all copies and that this |
---|
15 | ## notice is included verbatim in any distributions. No written agreement, |
---|
16 | ## license, or royalty fee is required for any of the authorized uses. |
---|
17 | ## Modifications to this software may be copyrighted by their authors |
---|
18 | ## and need not follow the licensing terms described here, provided that |
---|
19 | ## the new terms are clearly indicated on the first page of each file where |
---|
20 | ## they apply. |
---|
21 | ## |
---|
22 | ######COPYRIGHTEND#### |
---|
23 | |
---|
24 | ##------------------------------------------------------------------------------ |
---|
25 | |
---|
26 | .file "crt0-eval.S" |
---|
27 | |
---|
28 | ##------------------------------------------------------------------------------ |
---|
29 | ## Startup code |
---|
30 | |
---|
31 | .equ DRAM_TOP,0x48100000 |
---|
32 | |
---|
33 | .text |
---|
34 | |
---|
35 | .globl __start |
---|
36 | __start: |
---|
37 | # Set up stack. Leave 4K at top for use by Cygmon. |
---|
38 | |
---|
39 | mov DRAM_TOP - 0x1000,a0 |
---|
40 | sub 8,a0 |
---|
41 | mov a0,sp |
---|
42 | |
---|
43 | # Clear BSS |
---|
44 | |
---|
45 | mov __bss_start,a0 |
---|
46 | mov _end,a1 |
---|
47 | |
---|
48 | cmp a0,a1 |
---|
49 | beq 8f |
---|
50 | clr d0 |
---|
51 | 1: |
---|
52 | movbu d0,(a0) |
---|
53 | inc a0 |
---|
54 | cmp a0,a1 |
---|
55 | bne 1b |
---|
56 | 8: |
---|
57 | # Call constructors |
---|
58 | |
---|
59 | .extern ___main |
---|
60 | call ___main,[],0 |
---|
61 | |
---|
62 | # Call main |
---|
63 | clr d0 |
---|
64 | clr d1 |
---|
65 | mov d0,(4,sp) |
---|
66 | |
---|
67 | 9: |
---|
68 | or 0x0800,psw # Enable interrupts |
---|
69 | |
---|
70 | .extern _main |
---|
71 | call _main,[],0 |
---|
72 | |
---|
73 | .extern __exit |
---|
74 | call __exit,[],0 |
---|
75 | |
---|
76 | # bra 9b # Loop if we return |
---|
77 | |
---|
78 | |
---|
79 | |
---|
80 | ##------------------------------------------------------------------------------ |
---|
81 | ## end of crt0-eval.S |
---|
82 | |
---|
Note: See
TracBrowser
for help on using the repository browser.