No PUSH or POP assembler e200z4d PPC instructions :(

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

No PUSH or POP assembler e200z4d PPC instructions :(

ソリューションへジャンプ
3,853件の閲覧回数
peteradamcik
Contributor III

Hi Guys, just started PPC assembler programming and I wrote a subroutine that jumps to another subroutine which YES jumps to another subroutine using the BL (branch and link) instruction. I assumed it automatically saves the link return address on to the stack and on every BLR it grabs the last return address from the stack and returns program execution to that address. Well guess what? LOL. It doesn't.... so it looks like I have to manually write the return address to a user stack. This is just like the MIPS CPU, no PUSH or POP instructions. Yet the Texas Instruments F28377D DOES have PUSH and POP. 

Ok, is there a special way ( in assembler ) to write to the system stack or do I have to manually create a user stack in internal SRAM and use that?

Any help or assembler snippets would be greatly appreciated.

Thanks guys, hope to hear from you soon. Pete

0 件の賞賛
返信
1 解決策
3,844件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, assembler does not have PUSH/POP istructions, because PowerArch does not exclicitly define stack. r1 is defined as stack pointer by EABI but it is only convention.

Stack frame is needed to create manually, as it is for istance in the IntcInterrupts.c file if nesting is used.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
3,845件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, assembler does not have PUSH/POP istructions, because PowerArch does not exclicitly define stack. r1 is defined as stack pointer by EABI but it is only convention.

Stack frame is needed to create manually, as it is for istance in the IntcInterrupts.c file if nesting is used.

0 件の賞賛
返信
3,837件の閲覧回数
peteradamcik
Contributor III

Hi David, thanks for that muchly appreciated. All I need to do is save the LR to a user stack in user allocated ram space and increment or decrement the pointer to simulate PUSH and POP. 

All good, thanks for that.

Peter

 

0 件の賞賛
返信