I’ve updated the code to make it more robust. Previously the user
had to ensure a named definition was present immediately after
PERM. That’s no longer necessary as one is created automatically.
\ Transient definitions. Load TRANSient code in high memory
\ (e.g. assembler) and DISCARD when no longer needed.
2variable tlnk
: trans ( size -- )
aligned latest @ align ihere tlnk 2!
flash hi ram 1+ swap - [ latest #6 - ] literal ! ;
: perm ( -- ) tlnk cell+ @ [ latest #6 - ] literal !
latest @ i, ihere $2001 i, latest ! \ dummy def for discard
;
: discard ( -- ) tlnk 2@ ! ;
\ example
$100 trans
: foo ;
perm
: bar ;
discard
|