On Thu, 10 Feb 2000, Scott Dattalo wrote: > Cool! Now that you write this, I recall someone else (I believe it was > Payson) doing something similar. Now that you've got the 'context > switching' all confined to one section, you've opened up the possibilities > of extending its functionality (without having duplicate code snippets > scattered throughout). > > 1) You could easily add additional tasks. Cycling through each can be > done in a 'round-robin' fashion. For example, after task A then run task > B, C,..., N, and back to A. This should be doable with N-1 bytes of context and N-1 'exchange w with context+X' tuples. Can't see a clean way to make it work across the address space though. Your stack preload idea got me to thinking I could use the stack as a context table for 8 tasks, i.e. 'switch' would be 'call dispatch', dispatch would increment the stack pointer and return. But... there's no way to increment the stack pointer... and anyway, subroutines are our friends. :) --- Rich