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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [newlib/] [libc/] [sys/] [h8500hms/] [crt0.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
 
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
}

powered by: WebSVN 2.1.0

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