Shop OBEX P1 Docs P2 Docs Learn Events
Propeller-2 set up a stack? — Parallax Forums

Propeller-2 set up a stack?

How do I set up a stack for assembly-language subroutine calls in an assembly-language program? Perhaps each cog has its own stack at a defined address? The V33 docs are silent on this topic and mention "stack" only 6 times. Searches here and elsewhere didn't provide any guidance. Thank you. --Jon

Comments

  • Each cog has a built-in stack that can hold 8(?) longs. This stack is not part of any other memory.

    Alternatively, you can use the memory pointed to by the PTRA or PTRB register as a call stack using the CALLA/CALLB and RETA/RETB instructions in place of the normal CALL/RET instructions.
  • Just like the Intel 8008 (circa 1973) with a few levels of built-in stack storage. Thanks for explaining the stack, Wuerful_21. I appreciate your help. --Jon
  • Internal stack size is 8.
    remember address and carry/zero flag is pushed/popped
Sign In or Register to comment.