NEC ELECTRONICS GLOBAL
nec electronics global
HOME
APPLICATIONS
PRODUCTS
TECHNOLOGY
SUPPORT
BUY ONLINE
NEWS & EVENTS
ABOUT US
header
GO
AdvancedParametric
SITE MAP CONTACT US

[CA850] Startup Module

Contents

    
FAQ-ID = CA850_Startup-nnnn
0971: What setting should be made to locate a stack area at specified addresses?
CA850_Startup
-0971
What setting should be made to locate a stack area at specified addresses?
Q1
In the default startup routine, a stack area is allocated to a .bss section.
What setting should be made to locate a stack area at specified addresses?
A1
To locate a stack area at specified addresses, the stack area must be allocated to a section other than .bss.

This can be done by specifying the most significant address of the section + 1 (must be arranged at a 4-byte boundary) to the sp register (r3 register) in the startup routine, and specifying the address of the section with a link directive.

Example:

To create a stack area of a 0x200-byte section from address 0x3ffee00 in the section name of .stack


[Allocating stack area in assembler source]
	.set STACKSIZE, 0x200
	.section ".stack", bss 
	.lcomm	__stack, STACKSIZE, 4

[sp register setting in startup routine]
	mov	#__stack+STACKSIZE, sp

[Specifying by link directive]
STACK    : !LOAD ?RW V0x3ffee00 {
        .stack          = $NOBITS       ?AW .stack;
};


Is this information useful for you ?
back to top  
(2006/08)









































 LEGAL  RSS Feeds       © 1995-2008  NEC Electronics Corporation