Site Mirror:   USA  |  China
  Home   Products   Service   Order   Support   Forum   Company   Download 
 

  Support


>> FAQ
 
 
>> FAQ Search
 
 
>> Support Contact
 
 
>> Online Support
 
 
 


Answer


FAQ >> Embest IDE for ARM >> Instructions and codes


Date   2005-7-29 11:22:02
Question   About stack of ARM7
Answer
 Corresponding form of Registers of ARM7: 
R0 R0 
.. .. 
R9 R9 
R10 ---> SL 
R11 ---> FP FRAME POINTER ( base stack point to stack bottom)
R12 ---> IP 
R13 ---> SP STACK POINTER (register of stack pointer (SP) point to top of stack
R14 ---> LR 
R15 ---> PC 


graphical illustration of stack (stack-->arm7.cpp): 
ARM7 uses r11 register as stack bottom pointer and r13 as current top of stack under gcc2.95/2.97 compilation.
A typical function stack’s information structure is as below: 
                 memory high address 
        ----------------------------------------------  
       |       current function parameter         |  
     -----------------------<-------- last function top stack (r12)
       |  PC value (no use) when enter function   |  
       ------------------------- <--------bottom stack (r11) 
 function   |  return address of current function | 
                  ------------------------------  
                |  r13 register value of last function  | 
                  ------------------------------ 
 stack       |  r11 register value of last function  | 
                 ------------------------------ 
               |  local variable of current function   |  
                 ------------------------------ 
               | parameter pass to next function    |  
     ------------------------- <-------- top of stack (r13) 

memory low address
( Notice: set value to r11 is to set PC value not return address of function)

 Embest Info&Tech Co., Ltd. Copyright © 2000-2010, All rights reserved.

Room 509, Luohu Science&Technology Building, #85 Taining Road, Shenzhen, Guangdong, China(518020)
Tel: +86-755-25635656   Fax: +86-755-25616057  http://www.armkits.com  http://www.embedinfo.com 
Report any problems to the webmaster.