Difference between revisions of "Merging BASIC programs"

From BeebWiki
Jump to: navigation, search
m (1 revision)
(No difference)

Revision as of 01:00, 8 March 2015

You can merge two BASIC programs together by loading a second program at the end of the one in memory, but overwriting the end-of-program marker two bytes below TOP.

 >LOAD "part1"
 >OSCLI "LOAD part2 "+STR$~(TOP-2):END

The END is needed to tell BASIC to update its internal pointers. This method is used by the BASIC Make system commonly used with BASIC libraries such as the ones at mdfs.net/blib.