Last change
on this file since 444 was
444,
checked in by satin@…, 6 years ago
|
add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc
|
File size:
528 bytes
|
Rev | Line | |
---|
[444] | 1 | |
---|
| 2 | extern char _start_bss; |
---|
| 3 | extern char end; |
---|
| 4 | extern char stack; |
---|
| 5 | |
---|
| 6 | static zeroandrun(); |
---|
| 7 | #pragma noprolog |
---|
| 8 | |
---|
| 9 | start() |
---|
| 10 | { |
---|
| 11 | asm("mov.w #%off(_stack),sp"); |
---|
| 12 | /* asm("ldc.w #0x700,sr");*/ |
---|
| 13 | asm("ldc.b #%page(_stack),tp"); |
---|
| 14 | asm("ldc.b #%page(_stack),dp"); |
---|
| 15 | asm("ldc.b #%page(_stack),ep"); |
---|
| 16 | /* Can't have anything else in here, since the fp won't be set up |
---|
| 17 | so local variables won't work */ |
---|
| 18 | zeroandrun(); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | static |
---|
| 22 | zeroandrun() |
---|
| 23 | { |
---|
| 24 | char *p; |
---|
| 25 | p = &_start_bss; |
---|
| 26 | while (p < &end) |
---|
| 27 | { |
---|
| 28 | *p++ = 0; |
---|
| 29 | } |
---|
| 30 | main(); |
---|
| 31 | _exit(); |
---|
| 32 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.