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

Because it really is being stored in SSAVE. Note the predecrement of U in the
line above it. SSAVE is exctly the same as the previously unnamed cell before
S0. It is NOT a backup copy of S0. S0 contains the base address of the task's
empty stack. SSAVE (or S0 CELL- in older systems) is the saved S when the task
is suspended.
We never shipped a system with ACTIVATE and LAUNCH as shown below. These must
have been modified locally.
> -----Original Message-----
> From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On Behalf
> Of Bulgrien, Dennis
> Sent: Thursday, April 11, 2002 11:09 AM
> To: swiftx_at_forth.com
> Subject: [swiftx] SSAVE CELL+ vs. S0
>
>
>
> 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.
----------------------------------------------------------------------
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:26:27 PDT
This archive was generated by hypermail 2.2.0 : Wed Jan 07 2009 - 03:04:23 PST