[Flashforth-devel] Transient definitions
Brought to you by:
oh2aun
From: Ed <dx...@gm...> - 2022-05-11 17:33:11
|
The following allows one to use the assembler and discard it when done. Briefly tested on AVR FF dated 2021-11-28. \ Transient definitions. Load TRANSient code in high memory (e.g. \ assembler) and DISCARD when no longer needed. NOTE: For DISCARD \ to work a named definition must immediately follow PERManent. 2variable tlnk : trans ( size -- ) aligned latest @ align ihere tlnk 2! flash hi ram 1+ swap - [ latest #6 - ] literal ! ; : perm ( -- ) tlnk cell+ @ [ latest #6 - ] literal ! ; : discard ( -- ) tlnk 2@ ! ; \ usage $100 trans : foo ; perm : bar ; discard |