OK... I am writing an environment for PalmOS and because its very module oriented, I wanted Cooperative multitasking using ErrSetJump and ErrLongJump and storing/restoring stacks via dynamic memory. Its a long story and I will post it once it works but I am stuck on writing the saved stack back to the real stack.
The idea is that after I use ErrLongJump to jump to the yield function to continue the code, I want to restore the stack that was saved previously in the yield before I used ErrSetJump there. The funny thing is that I can save and restore a stack if I do the Save and then the Restore function one after each other but I cannot Save in one place and Restore in another if ErrSetJump and ErrLongJump happens inbetween. Any ideas why that would happen? (I get the "run68k.c, Line:4425, Unhandled instr" error when it tries to use MemMove to copy from the saved stack to the real stack). Note that the copying code is fine... otherwise I wouldnt able to Save to the stack and then Restore from the stack. The problem is when I save the stack in one place of execution and restore it at another location. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
