blunn@KEYCORP.COM.AU wrote: > .......But not pre-emptive. > > I'm not aware of any mechanism to implement a pre-emptive context > > switch on a PIC without running a virtual machine, in which case > latency usually becomes an issue. > > As has been pointed out many times, only a minor extension to the > > PIC core is necessary to support pre-emption (which is to mirror > the top-of-stack entry in two file registers TOSL and TOSH and to > > provide a POP instruction). > > Now I would argue strongly that no application for which a PIC is > > the appropriate solution actually needs pre-emptive task > switching. > Usually, round-robin execution of independant (non-blocking) > state > machines combined with a trivial ISR is a satisfactory solution. > > The application that started this thread is a good case in point. > > Nevertheless, I can understand how the trivial nature of the > silicon > changes that are required makes the lack of them annoying to > those > users who desire the functionality. Bob: You sure do get most of my point, apparently (see the longish reply to your first post). The question is, is the addressable stack context swap model any less of an abstract model that any other method? There are plenty of stack based context swaps being done Right This Second that are taking an enormous amount of time compared to a modest PIC based context switch, even if the PIC code is classified as implementing a virtual machine. (Isn't the addressable stack solution also a virtual machine?) The reason that the PIC architecture is the way it is, is that's the way it was designed a really long time ago, when it was implemented in several pmos chips. It isn't a real RISC architecture in the sense of having come from the research done by IBM and others in the '80s; it's really more of a VOISC (very old, etc.). I had data sheets for the PIC from General Instruments when I was living in my first apartment; we moved out of it when my oldest son was about 2 or 3. He's 21 now. So, no one is going to fix it, 'cause it ain't broke. --Tom Rogers P.S. We choose not to use the PIC; it was way too slow and big. We picked another chip set from National, then switched to the brand new 6502.