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