Easy load and save with ToddyForth 1.4
Posted: Sun May 31, 2020 11:55 pm
I've made som words for ToddyForth 1.4, to easily load and save 10 pages for the new editor. So this saves and load 769 * 10 bytes with simple commands.
A new word needed is PAD$+ which adds strings with the pad.
If you want to save the 10 pages to NEWPRG.BLK and have it replace the old file with same name, then type:
You can load the 10 pages again with:
I've also made a little utility, that displays the first line of every 10 pages. This is helpful, if your first line on the page has a comment about the page's content.
Just type
If you want to add them permanently to your ToddyForth, you can load them with FLOAD and LOAD, and save the whole of ToddyForth afterward with this
(FSAVE saves the current vocabulary with the runtime of TForth. So ToddyForth has this new vocabulary next time it is loaded.)
A new word needed is PAD$+ which adds strings with the pad.
Code: Select all
( PAD$+ #8 )
: PAD$+ ( N_STARTPOS
STR_STRING2ADD N_STRLEN --
N_ENDPOS )
ROT DUP >R PAD +
SWAP DUP R> + >R
CMOVE
R> ;
Code: Select all
BSAVE NEWPRG
Code: Select all
: BSAVE ( -- )
0 S" >" PAD$+
BL WORD COUNT PAD$+
S" .BLK;32768,7690" PAD$+
PAD SWAP FSAVE ;
Code: Select all
BLOAD NEWPRG
Code: Select all
: BLOAD ( -- )
0 BL WORD COUNT PAD$+
S" .BLK;32768" PAD$+
PAD SWAP FLOAD ;
Just type
Code: Select all
INDEX
Code: Select all
: INDEX CLS
10 0 DO
32768 I 769 * + 32 TYPE
LOOP
;
Code: Select all
S" NEWTF" FSAVE