Session Support                                                                                                                 This library will allow you to save and later reload the currentRetroForth session. The filename is fixed (retro.session), but  other than that it works wonderfully.                                                                                                                                                                                                                           here last @                                                     : cleanup literal last ! literal h0 ! ;                         : windows cleanup 6 s e ;                                       : linux   cleanup 2 s e ;                                       : generic cleanup ." not supported yet" cr ;                    : freebsd cleanup ." not supported yet" cr ;                    : dex4u   cleanup ." not supported yet" cr ;                                                                                    loc:                                                             : fn s" retro.session" zt ;                                     : open 420 66 fn 3 5 syscall ;                                  : close 1 6 syscall drop ;                                                                                                                                                                                                                                     n e                                                              loc:                                                             : mlast macro last @ 0 block ! ;                                : flast forth last @ 0 block 4 + ! ;                            : heap  here  0 block 8 + ! ;                                   here ] mlast flast heap $140000 512 + ;                        ;loc alias #                                                                                                                   n e                                                              loc:                                                             : mlast 0 block @ macro last ! ;                                : flast 0 block 4 + @ forth last ! ;                            : heap  0 block 8 + @ h0 ! ;                                    here ] mlast flast heap ;                                      ;loc alias recall                                                                                                              n e                                                              : w open dup >r # tib 1024 + r> 3 4 syscall drop close recall ; : r open dup >r # tib 1024 + r> 3 3 syscall drop close recall ; ' w ' r                                                        ;loc alias reload alias save                                                                                                                                                                                                                                                                                                    loc:                                                             : fn s" retro.session" zt ;                                                                                                      from kernel32.dll                                               1 import CloseHandle        3 import OpenFile                   5 import ReadFile           5 import WriteFile                                                                                n e                                                              loc:                                                             : mlast macro last @ 0 block ! ;                                : flast forth last @ 0 block 4 + ! ;                            : heap  here  0 block 8 + ! ;                                   here ] mlast flast heap $140000 512 + ;                        ;loc alias #                                                                                                                   n e                                                              loc:                                                             : mlast 0 block @ macro last ! ;                                : flast 0 block 4 + @ forth last ! ;                            : heap  0 block 8 + @ h0 ! ;                                    here ] mlast flast heap ;                                      ;loc alias recall                                                                                                              n e                                                               variable current                                                : close current @ CloseHandle drop ;                            : open fn here $0000 OpenFile dup current ! ;                   : r open tib 1024 + # tib 0 ReadFile drop close recall ;        : open fn here $1001 OpenFile dup current ! ;                   : w open tib 1024 + # tib 0 WriteFile drop close recall ;       ' w  ' r                                                      ;loc alias reload  alias save                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   