1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/test/lib-arm/crt0.s Wed Aug 13 10:32:00 2008 +0000
1.12 +/* Start by setting up a stack */
1.13 + /* Set up the stack pointer to a fixed value */
1.16 + /* Setup a default stack-limit in-case the code has been
1.17 + compiled with "-mapcs-stack-check". Hard-wiring this value
1.18 + is not ideal, since there is currently no support for
1.19 + checking that the heap and stack have not collided, or that
1.20 + this default 64k is enough for the program being executed.
1.21 + However, it ensures that this simple crt0 world will not
1.22 + immediately cause an overflow event: */
1.23 + sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */
1.25 + /* Zero-out the BSS segment */
1.26 + mov a2, #0 /* Second arg: fill value */
1.27 + mov fp, a2 /* Null frame pointer */
1.28 + mov r7, a2 /* Null frame pointer for Thumb */
1.30 + ldr a1, .LC1 /* First arg: start of memory block */
1.32 + sub a3, a3, a1 /* Third arg: length of block */
1.35 + .word 0 /* padding */
1.38 + .word -1 /* Syscall # */
1.39 + .word 0 /* Arguments */
1.43 + /* Enter main with no arguments for now */
1.45 + mov r0, #0 /* no arguments */
1.46 + mov r1, #0 /* no argv either */
1.49 + bl exit /* Should not return */
1.51 + /* For Thumb, constants must be after the code since only
1.52 + positive offsets are supported for PC relative addresses. */