Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!UKANVAX!MARKV
From: MARKV@UKANVAX ("MARK GOODERUM - UNIV. OF KANSAS ACS - MARKV@UKANVAX")
Newsgroups: comp.lang.modula2
Subject: RE: Context switching using Logitec 3.03 question
Message-ID: 
Date: 24 Sep 89 15:56:00 GMT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: Modula2 List 
Organization: The Internet
Lines: 18

Hmm, you might try a hint or two from the oldest micro-computer operating
system, Amiga OS.

When the Amiga Exec (the top level manager in the OS) switches a task,
it saves the full register set from the old task, loads the new register
set for the task it is switching to, and then jumps to execution at the
point where it left off in the new task.  It should be noted that this
is 68000 family processor but the same technique should work for the
80XX family.  (This technique IS used in a 'semi' multitasking library
for the PC I use at work.)  Some M2 systems even provide some low level
calls like SAVEREGS and LOADREGs to make this easier.

One important point is for this approach to work properly, each task must
have it's own stack and it's own copy of local variables.  In M2 the
latter is a given (usually), but the former can take some juggling.

-Mark Gooderum
 MARKV@UKANVAX