source: trunk/libs/newlib/src/newlib/libc/sys/h8500hms/crt0.c @ 444

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
Line 
1
2extern char _start_bss;
3extern char end;
4extern char stack;
5
6static zeroandrun();
7#pragma noprolog
8
9start()
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
21static
22zeroandrun()
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.