Page 2 of 2

Re: Return to BASIC

Posted: Fri Sep 16, 2016 3:46 pm
by mrtinb

Code: Select all

LD HL,(ERR_SP)
LD SP,HL
RET
Result in a cold start of Toddy Forth only.
2016_09_16_15_37_47_Clipboard.gif
2016_09_16_15_37_47_Clipboard.gif (26.8 KiB) Viewed 4295 times
___________________________________________________________________________

Code: Select all

RST 08H
DEFB 0xFF
Has this picture for a while, and the resets the ZX81 and return to [K] and empty LIST.
2016_09_16_15_40_38_Clipboard.gif
2016_09_16_15_40_38_Clipboard.gif (36.96 KiB) Viewed 4295 times

Re: Return to BASIC

Posted: Fri Sep 16, 2016 7:17 pm
by PokeMon
Toddy Forth has some special modifications - so I think you couldn't use BASIC context here.
Not sure what you really want to do.
You could try to contact Kelly Murta, his name here is kmurta (for private message for example).
Sometimes he is online - from time to time but think will answer on messages. ;)

Re: Return to BASIC

Posted: Wed Sep 21, 2016 10:04 pm
by kmurta
mrtinb wrote:

Code: Select all

LD HL,(ERR_SP)
LD SP,HL
RET
Result in a cold start of Toddy Forth only.

Code: Select all

RST 08H
DEFB 0xFF
Has this picture for a while, and the resets the ZX81 and return to [K] and empty LIST.
This occur because Toddy Forth modifies the system stack (SP) so in a return to BASIC the system references are lost.

I do not know exactly what you want to do, but I think that a good definition for the word BYE can be this:

Code: Select all

: BYE 0 EXECUTE ;
or you can simply type 0 EXECUTE in interpret mode to restart the BASIC

Is not this your intention?

Re: Return to BASIC

Posted: Thu Sep 22, 2016 7:04 am
by mrtinb
I had hoped the program was still in BASIC, so I could jump back to Forth with a RUN or GOTO.

Re: Return to BASIC

Posted: Thu Sep 22, 2016 1:50 pm
by PokeMon
I guess that the basic context (system variables) are more or less destroyed when starting Toddy Forth. :|
If just the stack point would be modified, RST $8, DEFB 0xFF should work to switch back.
It just set the stack new and restart BASIC but doesn't restore all system variables.

Re: Return to BASIC

Posted: Fri Sep 23, 2016 4:25 am
by kmurta
PokeMon wrote:I guess that the basic context (system variables) are more or less destroyed when starting Toddy Forth. :|
If just the stack point would be modified, RST $8, DEFB 0xFF should work to switch back.
It just set the stack new and restart BASIC but doesn't restore all system variables.
The system variables are not changed, but the stack contents are overwrited by the forth return stack. To return to BASIC with RST $08 the stack contents should be restored.

Re: Return to BASIC

Posted: Fri Sep 23, 2016 4:40 am
by kmurta
mrtinb wrote:I had hoped the program was still in BASIC, so I could jump back to Forth with a RUN or GOTO.
Try this:

Code: Select all

ld hl,($4004)
dec hl
ld (hl),$3e
dec hl
ld sp,hl
ld hl,$0676
push hl
rst     08H             ; ERROR-1
defb    $0C             ; Error Report: BREAK - CONT repeats
2016-09-22.png
2016-09-22.png (71.25 KiB) Viewed 4195 times

Re: Return to BASIC

Posted: Fri Sep 23, 2016 6:49 am
by mrtinb
Tada! 8-) Wow! :shock: Thank you! :D