]> git.sur5r.net Git - freertos/blob - Demo/uIP_Demo_Rowley_ARM7/uip/crt0.asm
Start to re-arrange files to include FreeRTOS+ in main download.
[freertos] / Demo / uIP_Demo_Rowley_ARM7 / uip / crt0.asm
1 // Rowley C Compiler, runtime support.\r
2 //\r
3 // Copyright (c) 2001, 2002, 2003 Rowley Associates Limited.\r
4 //\r
5 // This file may be distributed under the terms of the License Agreement\r
6 // provided with this software.\r
7 //\r
8 // THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING THE\r
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
10 \r
11 ; Create sections\r
12         .data\r
13         .bss\r
14 \r
15 ; Go to code section.\r
16         .code\r
17 \r
18 ; Executed upon reset\r
19 __reset proc\r
20 \r
21 ; Turn off watchdog.  You can enable it in main() if required.\r
22         mov.w   #0x5a80, &0x120\r
23 \r
24 ; Set up stack.\r
25         mov.w   #RAM_Start_Address+RAM_Size, sp\r
26 \r
27 ; Copy from initialised data section to data section.\r
28         mov.w   #SFB(IDATA0), r15\r
29         mov.w   #data_init_begin, r14\r
30         mov.w   #data_init_end-data_init_begin, r13\r
31         call    #_memcpy\r
32 \r
33 ; Zero the bss.  Ensure the stack is not allocated in the bss!\r
34         mov.w   #SFB(UDATA0), r15\r
35         mov.w   #0, r14\r
36         mov.w   #SFE(UDATA0)-SFB(UDATA0), r13\r
37         call    #_memset\r
38 \r
39 ; Call user entry point void main(void).\r
40         call    #_main\r
41 \r
42 ; If main() returns, kick off again.\r
43         jmp     __reset\r
44         endproc\r
45 \r
46 ; Heap data structures; removed by the linker if the heap isn't used.\r
47         .break   \r
48         .data\r
49         align   WORD\r
50 ___heap_start__::\r
51         DW      0\r
52         DW      heap_size\r
53         DS      heap_size-4    \r
54 \r
55 ; Reset vector\r
56         .vectors\r
57         .keep\r
58         org     0x1e\r
59         dw      __reset\r
60 \r
61 ; Initialise the IDATA0 section by duplicating the contents into the\r
62 ; CONST section and copying them on startup.\r
63         .const\r
64 data_init_begin:\r
65         .init  "IDATA0"\r
66 data_init_end:\r