![]() | ||
| Home | SwiftX Archive | SwiftForth Archive | |

Why does SWIFTX\SRC\68K\TASKER.F ACTIVATE contains SSAVE CELL+ U) instead of
S0 U)?
CELL +USER SSAVE
CELL +USER S0
CODE ACTIVATE ( addr -- ) U A0 MOV \ Preserve task pointer
S )+ A1 MOV A1 ) U MOV \ Point at task being activated
[DEFINED] |N| [IF] \ Floating point stack?
N0 U) NSAVE U) MOV [THEN] \ Establish numeric stack pointer
WAKE #W STATUS U) MOV S0 U) A1 MOV \ Awaken task, A1= stack pointer
R )+ U -) MOV U A1 -) MOV \ Push address of task code
A1 SSAVE CELL+ U) MOV A0 U MOV \ Save task's stack pointer
RTS END-CODE
It differs from our chipForth ACTIVATE which contains W S0 CELL- U) MOV
which writes to the backup copy of S0 (SSAVE in SwiftX):
4+ 4 +USER S0 ( Initial data stack location - extra space for save)
CODE LAUNCH ( a aS)
U A0 MOV ( save current U)
S )+ U MOV ( replace w/ U of task we are working with)
CTR U) CLR ( set his PAD count to zero)
WAKE #H U ) MOV ( put WAKE into status cell of task
now the task is ready ro wake up)
S0 U) W MOV ( put empty stack location into W
we are borrowing W as a new task's stack pointer)
U W -) MOV ( push U onto his stack)
S )+ W -) MOV ( pop address of first word from our stack onto his
stack)
N0 U) N0 CELL- U) MOV ( copying N0 into N0 CELL -
so we are initializing the numeric stack)
W S0 CELL- U) MOV ( now we initialize the data stack w/ W, so when
this task awakens, it will have two items on it's
stack)
.
.
.
A0 U MOV NEXT
: ACTIVATE ( aT) R> SWAP @ LAUNCH ;
----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe swiftx" to listar_at_forth.com
For help with listar commands, send subject "help" to listar_at_forth.com
Archives are located at http://www.forth.com/swiftx -- check them out!
----------------------------------------------------------------------
THIS LIST IS NOT FOR BUG REPORTS! Send bug reports to support_at_forth.com.
Received on Thu Apr 11 2002 - 11:10:46 PDT
This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:23 PST