From a5fa681de468b1450136deaa2a6595097d1f578d Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Thu, 25 Feb 2021 09:49:29 -0800 Subject: [PATCH] Make save + restore able to task stack filename. --- ueforth/common/filetools.fs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ueforth/common/filetools.fs b/ueforth/common/filetools.fs index 3790b58..ce54964 100644 --- a/ueforth/common/filetools.fs +++ b/ueforth/common/filetools.fs @@ -10,20 +10,24 @@ $4000 constant growth-gap here growth-gap + growth-gap 1- + growth-gap 1- invert and constant saving-base : park-heap ( -- a ) saving-base ; : park-forth ( -- a ) saving-base cell+ ; -forth definitions also internals -: save ( "name" -- ) +: save-name 'heap @ park-heap ! forth-wordlist @ park-forth ! - bl parse w/o create-file throw >r + w/o create-file throw >r saving-base here over - r@ write-file throw r> close-file throw ; -: restore ( "name" -- ) - bl parse r/o open-file throw >r +: restore-name ( "name" -- ) + r/o open-file throw >r saving-base r@ file-size throw r@ read-file throw drop r> close-file throw park-heap @ 'heap ! park-forth @ forth-wordlist ! ; +forth definitions also internals + +: save ( "name" -- ) bl parse save-name ; +: restore ( "name" -- ) bl parse restore-name ; + only forth definitions