anchor.diff:  \  Round-robin list task handling - do not use in IRQ !
   \ -------------------------------------------------------
   
  -: stop ( -- ) false task-state ! pause ; \ Stop current task
  +: will-stop ( -- ) false task-state ! inline ; \ Stop current task at next pause
  +: wont-stop ( -- ) true task-state ! inline ; \ Do not stop current task at next pause
  +: stop ( -- ) will-stop pause inline ; \ Stop current task
   : multitask  ( -- ) ['] (pause) hook-pause ! ;
   : singletask ( -- ) [']  nop    hook-pause ! ;
   
  
positive.code:   until
    2drop false ;
  
  : previous ( task -- addr-of-task-before )
    \ Find the task that has the desired one in its next field
    >r next-task begin dup @ r@ <> while @ repeat rdrop ;
  
  : insert ( task -- ) \ Insert a task into the round-robin list
    dup task-in-list?  \ Is the desired task currently linked into ?
    if drop else next-task @ over ! next-task ! then ;
  
  : remove ( task -- ) \ Remove a task from the round-robin list
    dup task-in-list?  \ Is the desired task currently linked into ?
    if dup @ ( task next )
       swap previous ( next previous ) !
    else drop then ;
  
  \ -----------------------------------------
  
negative.code: \ Store the adjusted return stack pointer into the parameter stack
      !
  \ Store the desired entry address at top of the tasks return stack
    r> insert-task ;
  
  : activate ( task --   R: continue -- )
    true over 1 cells + ! \ Currently running
  