Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] How to setup Stacks in GNU

2004-12-28 by microbit

Hi Chris,

> Perhaps I am asking a real simple question, but for the life of me I 
> cannot find much information or example code on stack setup.  I'm 
> trying to move my IAR code over to GNU, and of course the GNU syntax 
> does not handle all of the ARM Asm coding.
> 
> In IAR they gave an example like this:
> 
>   mrs   r0,cpsr               /* Original PSR value  */
>   bic   r0,r0,#MODE_BITS      /* Clear the mode bits */
>   orr   r0,r0,#SVC_MODE       /* Set SVC mode bits   */
>   msr   cpsr_c,r0             /* Change the mode     */
>   ldr   sp,=SFE(SVC_STACK) & 0xFFFFFFF8  /* End of SVC_STACK */
> 
> The GNU compiler will take all of this - except for that last 
> statement.  I have no idea what that "SFE" command is doing and 
> neither does GNU apparently.  I can't even find anything on this in 
> the ARM7 Instruction set manual.
> 
> What is this last statement doing, and what would be the correct 
> equiv to use in GNU?

I'm doing a few quick tests on EWARM kickstart to see how the code/s[eed generation
really compares to GCC.
When I'm done shortly I'll have a look, I had changed the startup code anyway.

But I'd say off-the-cuff that SFE is an intrinsic (macro) to do something
with the lookup address of SVC_STACK.
Have a look around in your IAR docs under "intrinsics" or somesuch.

When I'm done with the tests, I'll have a look if you haven't figured it in the meantime.

-- Kris


[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.