Wouter van Ooijen wrote > > Ok so the only real > > problem is the ability > > to do pre-emptively multitasking > > I consider that a serious drawback, and I would add 8 levels is a bit > short for chips that have up to 8k of code. Hi Wouter, I hope you will agree that the greatest benefit in using co-operative multitasking over pre-emptive multitasking is the ability to control where task switching occurs. In large embedded systems it is often a real problem that a task switch can occur anywhere and at any time. Often in such a system, the tasks need to take serious measures to ensure that critical sections of code are not interrupted or that access to resources are serialised. Co-operative multitasking trashes these problems without even trying. I personally consider the lose of pre-emptively multitasking on the PIC 16 series only a small annoyance and not a serious drawback. I also used to think that an 8 level stack was a pain, but after considerable work with these PICs I have come to realise that it is more of an annoyance than a real problem. Yes it would be nice to use "call" and "return" instructions without worrying about the level of the stack, but I now see this in the same way I see 16 bit arithmetic on the PIC - instead of one instruction to do a 16 bit add I must use a few, instead of one instruction to do a "call" I sometimes need to use a few. If you use a macro to handle calls to other code pages, why not use a macro to handle calls off the hardware stack. Treat the hardware stack as a special resource, one that allows you to execute short sequences of instructions very quickly with minimal overhead and leave big functions to be called with your special "out-of-hardware-stack" macro. The only thing we really need the hardware stack for on the PIC 16 series is interrupt handling and the god awful table lookups. > > NB I totally agree with your static stack argument. Just take a look at > the bulky code produced by C18 (which uses a real SP-offset local > variables). > > Wouter van Ooijen Regards Sergio Masci http://www.xcprod.com/titan/XCSB - optiming structured PIC BASIC compiler -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body