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:     sp@ >r handler @ >r rp@ handler !  execute
      r> handler !  rdrop  0 unloop ;
  
  : throw ( throwcode -- )  dup if
    handler @ 0= if false task-state ! then \ unhandled error: stop task
      handler @ rp! r> handler ! r> swap >r sp! drop r>
      unloop  exit
      else  drop  then ;
  
  \ --------------------------------------------------
  \  Lowpower mode
  
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
  