Analyze stack for MPC5604B with Codewarrior 2.7

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Analyze stack for MPC5604B with Codewarrior 2.7

跳至解决方案
1,325 次查看
MicroTang
Contributor III

Dear All,

 

I am using Freescale C/C++ Compiler for Embedded PowerPC (version 4.3 build 182) to build my project on MPC5604B. I can read stack information from MAP file, e.g..

 

_stack_addr 40003000

_stack_end  40002a00

 

Does it mean stack bottom is $40002a00 and stack pointer is initialized to 0x4000300? I checked my code, it seems that r1 is used to save stack pointer and the stack grows from high address to low address. Is it right? If there are any documents (notes, manual, guide, etc) describe more details about how does the compiler use the stack of MPC5604B?

 

Thanks in advance for your help!

 

Best Regards

Michael Tang

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,056 次查看
stanish
NXP Employee
NXP Employee

Hi MicroTang,

 

You are right the register dedicated to stack pointer is r1 and stack grows downward from high addresses.

This is defined in PPC EABI specification available here:

 

http://www.freescale.com/files/32bit/doc/ref_manual/E500ABIUG.pdf

 

Stanish

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,057 次查看
stanish
NXP Employee
NXP Employee

Hi MicroTang,

 

You are right the register dedicated to stack pointer is r1 and stack grows downward from high addresses.

This is defined in PPC EABI specification available here:

 

http://www.freescale.com/files/32bit/doc/ref_manual/E500ABIUG.pdf

 

Stanish

0 项奖励
回复
1,056 次查看
MicroTang
Contributor III

Hello, Stanish

 

Thanks for your kindly help!

 

Best Regards

Michael

0 项奖励
回复