- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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