[PicForth] Re: multitasker.fs question

Samuel Tardieu sam at rfc1149.net
Mon Dec 6 12:25:48 CET 2004


>>>>> "David" == David McNab <david at rebirthing.co.nz> 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 -- sam at rfc1149.net -- http://www.rfc1149.net/sam



More information about the PicForth mailing list