Hi David,

> I can now reliably reproduce the problem with quite a small amount of code
> and without the xbee. Because of this I now have the normal forth
> interaction which makes debugging easier.

Absolutely

I used your code and it worked without problems. That's the
bad news (for you).

> 
> The next two lines in (evaluate) are:
> 
> 
>     ['] source-string is source
> 
>     ['] interpret catch
> 
> but something seems to be going wrong but I just can't figure it out.

Ok, thats look closely, what happens at RESET. First code is COLD. 
(cold.asm). Here the two stackpointers and the USER pointer is 
initialized. After that, the inner interpreter takes over with
WARM (warm.asm) as its starting point. WARM first copies the 
initial USER data from EEPROM to the actual USER area. The PAUSE
vector is directed to NOOP and now TURNKEY is called. When TURNKEY
is finished, QUIT is started and it runs the REFILL/INTERPRET loop
endlessly.

It seems, that something is done in QUIT that is not yet done when
TURNKEY is active. This lead to the fact, that calling the runte
word interactivly never caused a problem, but calling it in turnkey
has intermittant troubles.

The only thing that I found, was the setup of STATE (left-bracket).

The lines (from quit.asm)
    .dw XT_SP0
    .dw XT_SP_STORE
    .dw XT_RP0
    .dw XT_RP_STORE
should do no harm during RESET, since they copy data which is 
already present.

Since INTERPRET uses STATE internally, having it left at a random
value may cause trouble. Could you add a line to warm.asm
so that it looks like

    .dw XT_DEFERSTORE
    .dw XT_LBRACKET    ; <<-- new line
    .dw XT_TURNKEY

and re-do your tests?

Matthias

------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to