Keil™, An ARM® Company

RealView Libraries and Floating Point Support Guide

Creating the stack

3.3.1. Creating the stack

Specify the initial stack pointer by defining a symbol __initial_sp to be equal to the top of the stack. The initial stack pointer must be aligned to a multiple of eight bytes.

Example 3.4 shows how to set up the initial stack pointer using assembly language.

Example 3.4. Assembly language

    EXPORT __initial_sp
__initial_sp EQU 0x100000        ; equal to the top of the stack

Example 3.5 shows how to set up the initial stack pointer using embedded assembler in C.

Example 3.5. Embedded Assembler in C

__asm void dummy_function(void)
{
    EXPORT __initial_sp
__initial_sp EQU 0x100000        ; equal to the top of the stack
}
Copyright © 2007 ARM Limited. All rights reserved.ARM DUI 0378A