Re: multitasker.fs question

Samuel Tardieu <[email protected]> 06 Dec 2004 12:25:48 +0100
Newsgroups gmane.comp.lang.forth.picforth
Organization Avian Carrier & Friends
Message-ID <[email protected]>
>>>>> "David" == David McNab <[email protected]> writes:

David> Just one question - given that the return stack on PIC16F chips
David> is totally non-addressible, does this mean that 'yield'
David> instructions may only occur in the very top level of each task?

David> In other words, would I crap on the return stack if task 'fred'
David> calls word 'mary', and 'mary' sits in a loop periodically
David> executing a 'yield'?

David> If this is the case (I expect it would be), then it might be
David> worth a mention in the doco.

Yes, unfortunately this is a limitation. It would be possible to write
a full multitasker, but it would require that we do not use "call" and
"return" but use "goto" instead and maintain our own return stack
(which would be painfully slow as we only have one FSR).

I'll add a note in the documentation.

  Sam
-- 
Samuel Tardieu -- [email protected] -- http://www.rfc1149.net/sam