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

How to reply: Use your email client's "Reply All" function to reply to the
entire list (preferred). Use "Reply" for a private reply to the sender.
--------------------------------------------------------------------------
Hello all,
I am a little confused about the use of current memory sections and defining
words and thought I would throw it out for discussion.
The SwiftX manual states that IDATA is the normal default section type.
With IDATA selected, any defining words that you create (along with some
bundled ones) put the body of the definitions in IDATA. For instance
TERMINAL and BACKGROUND put the body in IDATA, so the pointers to STATUS and
SO are wasting 4 bytes of RAM. It seems odd to declare CDATA every time you
use TERMINAL or BACKGROUND.
As an example if you define CONSTANT as
: CONSTANT CREATE , DOES> @ ;
and then use it with IDATA as the current section it makes a CONSTANT in
RAM!?
VARIABLE, CVARIABLE and BUFFER: always place the body in UDATA but I can't
find any source to study so I am not sure how it is done. I have created
defining words which change the current memory sections but it sure gets
messy and I am not sure how to restore them to what was previously set.
Don't know if any of you have looked at J.V. Noble's Finite State Machine
http://www.jfar.org/article001.html but here is how I had to implement it in
Swift X. Is this the proper way?
INTERPRETER
: FSM: ( width, initial state --- )
CDATA CREATE
IDATA HERE SWAP , ,C ,C ;
: || ' ,C ' ,C ; \ add to xt's to data field
: ;FSM DOES> ( col# adr -- )
DUP >R 2@ C@ * + ( -- col#+width*state )
2* 2 + CELLS ( -- relative offset )
R@ + ( -- adr[action] )
DUP >R ( -- adr[action] )
@EXECUTE ( ? )
R> CELL+ ( -- ? offset-to-update)
@EXECUTE ( -- ? state')
R> @ C! ; ( ? ) \ update state
TARGET
so...
What is everyone else doing in these situations?
Thomas Talkington
Travel Asset Group Ltd
480-491-2096 (office)
480-236-2992 (cell)
----------------------------------------------------------------------
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 Tue Jan 21 2003 - 13:40:41 PST
This archive was generated by hypermail 2.2.0 : Mon Dec 01 2008 - 03:04:47 PST