1 // Rowley C Compiler, runtime support.
\r
3 // Copyright (c) 2001, 2002, 2003 Rowley Associates Limited.
\r
5 // This file may be distributed under the terms of the License Agreement
\r
6 // provided with this software.
\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
15 ; Go to code section.
\r
18 ; Executed upon reset
\r
21 ; Turn off watchdog. You can enable it in main() if required.
\r
22 mov.w #0x5a80, &0x120
\r
25 mov.w #RAM_Start_Address+RAM_Size, sp
\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
33 ; Zero the bss. Ensure the stack is not allocated in the bss!
\r
34 mov.w #SFB(UDATA0), r15
\r
36 mov.w #SFE(UDATA0)-SFB(UDATA0), r13
\r
39 ; Call user entry point void main(void).
\r
42 ; If main() returns, kick off again.
\r
46 ; Heap data structures; removed by the linker if the heap isn't used.
\r
61 ; Initialise the IDATA0 section by duplicating the contents into the
\r
62 ; CONST section and copying them on startup.
\r