Make save + restore able to task stack filename.
This commit is contained in:
@ -10,20 +10,24 @@ $4000 constant growth-gap
|
|||||||
here growth-gap + growth-gap 1- + growth-gap 1- invert and constant saving-base
|
here growth-gap + growth-gap 1- + growth-gap 1- invert and constant saving-base
|
||||||
: park-heap ( -- a ) saving-base ;
|
: park-heap ( -- a ) saving-base ;
|
||||||
: park-forth ( -- a ) saving-base cell+ ;
|
: park-forth ( -- a ) saving-base cell+ ;
|
||||||
forth definitions also internals
|
|
||||||
|
|
||||||
: save ( "name" -- )
|
: save-name
|
||||||
'heap @ park-heap !
|
'heap @ park-heap !
|
||||||
forth-wordlist @ park-forth !
|
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
|
saving-base here over - r@ write-file throw
|
||||||
r> close-file throw ;
|
r> close-file throw ;
|
||||||
|
|
||||||
: restore ( "name" -- )
|
: restore-name ( "name" -- )
|
||||||
bl parse r/o open-file throw >r
|
r/o open-file throw >r
|
||||||
saving-base r@ file-size throw r@ read-file throw drop
|
saving-base r@ file-size throw r@ read-file throw drop
|
||||||
r> close-file throw
|
r> close-file throw
|
||||||
park-heap @ 'heap !
|
park-heap @ 'heap !
|
||||||
park-forth @ forth-wordlist ! ;
|
park-forth @ forth-wordlist ! ;
|
||||||
|
|
||||||
|
forth definitions also internals
|
||||||
|
|
||||||
|
: save ( "name" -- ) bl parse save-name ;
|
||||||
|
: restore ( "name" -- ) bl parse restore-name ;
|
||||||
|
|
||||||
only forth definitions
|
only forth definitions
|
||||||
|
|||||||
Reference in New Issue
Block a user