1 /* Sample initialization file */
\r
6 /* .text is used instead of .section .text so it works with arm-aout too. */
\r
11 .global _mainCRTStartup
\r
18 /* Start by setting up a stack */
\r
19 /* Set up the stack pointer to end of bss */
\r
23 sub sl, sp, #512 /* Still assumes 512 bytes below sl */
\r
25 mov a2, #0 /* Second arg: fill value */
\r
26 mov fp, a2 /* Null frame pointer */
\r
27 mov r7, a2 /* Null frame pointer for Thumb */
\r
29 ldr a1, .LC1 /* First arg: start of memory block */
\r
30 ldr a3, .LC2 /* Second arg: end of memory block */
\r
31 sub a3, a3, a1 /* Third arg: length of block */
\r
33 mov r0, #0 /* no arguments */
\r
34 mov r1, #0 /* no argv either */
\r
37 bl exit /* Should not return */
\r
39 /* For Thumb, constants must be after the code since only
\r
40 positive offsets are supported for PC relative addresses. */
\r